Attributeerror: Module 'Cv2.Cv2' Has No Attribute 'Createlbphfacerecognizer'

module 'cv2' has no attribute 'face'

I fix this problem with using this commands.

pip uninstall opencv-contrib-python

pip install opencv-contrib-python==4.4.0.46

AttributeError: module 'cv2.cv2' has no attribtue 'face'

it work after i install a lower version of opencv-contrib-python which is same as my opencv-python version.

pip install opencv-contrib-python==3.4.6.27

How to fix ERROR : Module 'cv2' has no attribute 'legacy' on python 3.7.9 and Windows 11?

I don't have this problem anymore so I will share what I did to make it work.

As Christoph Rackwitz mentionned opencv-contrib-python alone works just fine with the version 4.5.5.62 (latest version) to use the function cv2.dnn_superres.

I personnally had to uninstall all previous installations dealing with opencv :

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip uninstall opencv-contrib-python-headless

Then I deleted all files that had to do with opencv too : after the uninstallation a "cv2" file and "opencv_contrib_python-4.5.2.52.dist-info" remained and caused errors.

Once all these files were deleted I reinstalled opencv-contrib with the right version using :

pip3 install opencv-contrib-python==4.5.5.62

It appeared in the Python\Lib\site-packages directory and now I can use cv2 just fine.

Thank you for your help, I hope it will help others.

AttributeError: module 'cv2.cv2' has no attribute 'faces' in OpenCV

Try update OpenCV with

pip install opencv-contrib-python

AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' in python 3.6.4 and opencv 3.4

You likely have the opencv-python package installed instead of the opencv-contrib-python package. A lot of the proprietary algorithms were removed from the main OpenCV repository when OpenCV came out and put in the contrib repository.

Try switching versions.

cv2 does not have an attribute 'face'

Faced the same issue once, use the below mentioned function and I hope it solves the issue.

recognizer = cv2.face.LBPHFaceRecognizer_create()


Related Topics



Leave a reply



Submit