shantnu / FaceDetect

825 stars 1.25k forks source link

module attribute error #12

Closed jkariscodes closed 6 years ago

jkariscodes commented 7 years ago

Hi? I am getting an error on running the command

Traceback (most recent call last): File "face_detect.py", line 21, in flags = cv2.cv.CV_HAAR_SCALE_IMAGE AttributeError: 'module' object has no attribute 'cv'

arawal commented 7 years ago

Looks like you can go around the error by just removing the flags field. Still seems to work. UPDATE with opencv v3 (cv2 is still the module name, which makes it confusing), you can replace it with flags = cv2.CASCADE_SCALE_IMAGE (Solution at http://stackoverflow.com/questions/36242860/attribute-error-while-using-opencv-for-face-recognition) @shantnu : Why do we need that field?

shantnu commented 7 years ago

The code supports both opencv2 and 3. The flag is needed for one of them.

On 7 Feb 2017, at 16:59, Akshar Rawal notifications@github.com wrote:

Looks like you can go around the error by just removing the flags field. Still seems to work. @shantnu : Why do we need that field?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.