AttributeError:模块"cv2.cv2"没有属性"createLBPHFaceRecognizer" [英] AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

查看:155
本文介绍了AttributeError:模块"cv2.cv2"没有属性"createLBPHFaceRecognizer"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在识别代码时遇到一些属性错误.我的脸部检测代码可以完美运行,但是当我尝试运行人脸识别代码时,它显示出一些属性错误.我用谷歌搜索并尝试遵循所有步骤.但是,它仍然显示相同的错误.这是我的代码:

I am facing some attribute error while running face recognizing the code. My face detects code run perfectly.But while I try to run the face recognizing code it shows some attribute error. I googled and tried to follow all the steps. But still, it shows the same error. Here is my code:

人脸识别

,我收到以下错误消息:

and I get the following error:

C:\Users\MAN\AppData\Local\Programs\Python\Python36\python.exe C:/Users/MAN/PycharmProjects/facerecognition/Recognise/recognize1.py
Traceback (most recent call last):
  File "C:/Users/MAN/PycharmProjects/facerecognition/Recognise/recognize1.py", line 4, in <module>
    recognizer = cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

Process finished with exit code 1.

我正在使用Windows平台. python 3.6版本.谢谢.

I am using Windows platform. python 3.6 version.Thanks in advance.

推荐答案

您需要安装opencv-contrib

You need to install opencv-contrib

pip install opencv-contrib-python

它应该在那之后工作.

这篇关于AttributeError:模块"cv2.cv2"没有属性"createLBPHFaceRecognizer"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆