Search code examples
pythonopencvface-recognition

Face recognition using python and opencv


I want to work on this face recognition project but when I run the train.py, I get the following error:

recognizer = cv2.face.createFisherFaceRecognizer()
AttributeError: 'module' object has no attribute 'face'

I've googled it but I didn't find anything useful.

I'm running python 2.7 and OpenCV 3.2.0.

Any help would be appreciated.


Solution

  • As @DanMašek in the comments said, the answer is to add the open_contrib module in the OpenCV to use face module. It can be done while installing OpenCV, like this:

    brew install opencv3 --with-contrib