2

I am using python 3.7 and latest version of openCV. When i try to create an EigenFaceRecognizer. This error pops up "module 'cv2.face' has no attribute createEigenFaceRecognizer. I have got this bellow code from a Gitub repo.

recognise = cv2.face.createEigenFaceRecognizer(15, 4000)
recognise.load("Recogniser/trainingDataEigan.xml")

1 Answer 1

1

I believe the face module is in the opencv-contrib library. You can install it with

pip uninstall opencv-contrib-python
pip install opencv-contrib-python --no-cache-dir

Also the function got changed to this. load was replaced with read

import cv2

recognise = cv2.face.EigenFaceRecognizer_create()  
recognise.read("Recogniser/trainingDataEigan.xml")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.