How to save trained data for Face recognisation
I am working on a face recognition program using cv2.createLBPHFaceRecognizer() on python given at: http://hanzratech.in/2015/02/03/face-...
I am able to add new faces in database however, I want to save the trained data in a file so that i don't have to retrain same database how could i do so.
if it's really about LBPH, i would not waste too much energy on that.
the "training" only consists of making lbph features from the images, which is done in a jiffy.
do that once , when your prog starts, then keep the trained model in memory. also remember, that there's an "update" method for LBPH (only), that allows you to add new faces to an already trained model.
but how do i store trained model in memory.I will rely appreciate if you can guide me through this or suggest me some links which can help me to implement LBPH as i am not much proficient in opencv
which opencv version is it ?
opencv 2.4.13 , python 2.7
hmm, looking at it, it does not really seem supported from python.
using https://github.com/opencv/opencv/blob... would be straightforward, unfortunately it's not wrapped into the python bindings (no cv::FileStorage there)
you'd have to use
recognizer.get("something")
on all of the properties here, do your own serialization, and userecognizer.set("something)
to put it back later.not a piece of cake. not funny. (and i'm quite sure, you don't even need it)
again, please measure the time used by recognozer.train(), before starting something desperate. (how many images do you plan to process ?)
again, if that's less than a million, - just train your recognizer instance, and keep it as long as possible.
i would need to train 200-500 image
so, don't bother.