HackerShackOfficial / AI-Smart-Mirror

Smart Mirror with a smart AI 🤖
MIT License
536 stars 217 forks source link

vision.py: AttributeError: 'module' object has no attribute 'cv' #58

Closed HoraceBury closed 6 years ago

HoraceBury commented 6 years ago

Got to the end of the instructions and everything works fine on macOS 10.12.6, then when running python vision.py I see this:

(hhsmartmirror) MyBook-Pro:AI-Smart-Mirror horace$ python vision.py
Traceback (most recent call last):
  File "vision.py", line 66, in <module>
    flags=cv2.cv.CV_HAAR_SCALE_IMAGE
AttributeError: 'module' object has no attribute 'cv'

I tried looking in the cv2.so file but it's a binary so I can't modify it. Any ideas?

HoraceBury commented 6 years ago

Found this post on SO:

Just open the vision.py file and change lines 39 and 66 from this:

flags=cv2.cv.CV_HAAR_SCALE_IMAGE

To this:

flags=cv2.CASCADE_SCALE_IMAGE