I am training a face recognition model using Fisher Face algorithm using OpenCV library and Python language.
fisherFace = cv2.face.FisherFaceRecognizer_create()
fisherFace.train(imagefaceList, np.array(labelsIndexList))
I want to save this model in file/memory. In other word i want to save 'fisherface' object. I have tried pickle module for saving this object using this. I am not able to pickle and unpickle this object.Code is as below:
class test(object):
def __init__(self, a):
self.a = a
def pickle_test(t):
print('pickling a test instance...')
return test, (t.a,)
copyreg.pickle(test, pickle_test)
t = test(f)
t1 = copy.copy(t)
t2 = pickle.dumps(t)
Is there any way available that saves trained model for fisher face algorithm and use it at other place by loading same model for face recognition?