Python - How do I utilize ALL cores of my CPU in training my FaceRecognizer?
I'm currently training my FisherFaceRecognizer
in Python and I noticed something strange. My processor is an Intel Core i5, and apparently only one of the cores is working in the training process - in the Task Manager the Python process also takes only 25% of the CPU usage. I think that using all four cores to train my FisherFaceRecognizer
would make the training process faster.
That said, I heard some things concerning the whole 'Global Interpreter Lock', so is it possible to use all four cores of my i5 processor for the training process, and if so, how?
EDIT: Would the multiprocessing
module make it possible?
you can't . the code is not parallelizised at all.
Is it even theoretically possible to somehow parallelize the training of a
FaceRecognizer
though?imho, you got the better chance with lbph here (which is processing all images independantly of each other), i'd personally give all up on hacking into the pca ;)
but in any case, you'd have to break into the code for it. maybe bytefish's alternative all-python implementation is the easier target to hack it (from python) ?
You mean
LbphFaceRecognizer
?yes. and here
By the way, what are the performance differences between the
FisherFaceRecognizer
,EigenFaceRecognizer
, and theLbphFaceRecognizer
?I've tried the
LBPHFaceRecognizer
. Its training time is indeed quick, but I can't use the resulting YAML file in my Android device, because it's 900 MB in size.