Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'cv2' has no attribute 'data' #5

Open
RoConverse opened this issue May 19, 2019 · 13 comments
Open

AttributeError: module 'cv2' has no attribute 'data' #5

RoConverse opened this issue May 19, 2019 · 13 comments

Comments

@RoConverse
Copy link

No description provided.

@vijayjadhav008
Copy link

Try installing opencv-contrib-python.
command:
pip install opencv-contrib-python

@KeerthanaThirumoorthy
Copy link

I get the same after after installing opencv-contrib! What should I do?

@sujitshodangi
Copy link

any fixes ?

@sujitshodangi
Copy link

Traceback (most recent call last):
File "app.py", line 9, in
faceCascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
AttributeError: module 'cv2' has no attribute 'data'

@abdulwahab215-ux
Copy link

Sir What about its data set?

@souravrs999
Copy link

Change it to:
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")

@CallShaul
Copy link

I had the same issue, this solved it for me:
pip install opencv-contrib-python --upgrade

@Rephil2
Copy link

Rephil2 commented Nov 3, 2020

Thanks @CallShaul! This fixed it for me too.

@zanivanusa
Copy link

having installed both python-opencv and opencv-contrib-python may cause some problems in the same environment (https://pypi.org/project/opencv-contrib-python/) be sure to uninstall before 1 before installing the other

@palakchanana
Copy link

detector = cv2.cascadeClassifier(haarcascadePath)
AttributeError: module 'cv2' has no attribute 'cascadeClassifier'
I am getting this . Can anyone fix this ?

@souravrs999
Copy link

detector = cv2.cascadeClassifier(haarcascadePath) AttributeError: module 'cv2' has no attribute 'cascadeClassifier' I am getting this . Can anyone fix this ?

It's Cascade classifier 'C' should be capitalized just a typo

@usernames-privacy
Copy link

I have pip uninstalled opencv-python and installed opencv-contrib-python but I still get this error.

This is the line with the problem: face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')

@kekeli3k
Copy link

@usernames-privacy am also facing the same issue. But i think the problem might stem from the cascade file not been available in the cv folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests