0

I was watching a course about Face Recognition in OpenCV from YouTube. But I am having trouble with a problem.

face_recognizer = cv2.face.LBPHFaceRecognizer_create()

When I write the codes you see above, it always says that when I run the program:

    face_recognizer = cv2.face.LBPHFaceRecognizer_create()
    AttributeError: module 'cv2' has no attribute 'face'

I've looked for the solutions, most of people had said that if you install the library "opencv-contrib-python", it will be solved. And I installed it. But it didn't work neither.

1 Answers1

0

You must download opencv-contrib-python package to solve this issue. Used the following pip install in your terminal.

pip install opencv-contrib-python

Also see the following answer: AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'