AttributeError: 'module' object has no attribute 'face' [closed]

asked 2015-10-09 09:54:53 -0600

LKM gravatar image

updated 2015-10-09 10:43:08 -0600

I am trying to install OpenCV with the extra modules in opencv_contrib on mac.

I have followed the instructions found here: https://github.com/Itseez/opencv_contrib but it has not worked, for example, when I try to run help(cv2.face) I get "AttributeError: 'module' object has no attribute 'face'"

When I look in opencv/build/modules I can see the face module.

I am using OpenCV 3.0.0 and Python 2.7 on mac OS X

Please can someone help me with this?

Thanks in advance!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2015-10-10 01:07:49.445337

Comments

did you run a 'make install' (or build the INSTALL project on win) ?

it seems, anything got built, but you're still using an older cv2.pyd

to make sure, try print cv2.getBuildInformation()

berak gravatar imageberak ( 2015-10-09 10:22:26 -0600 )edit

Thank you for your reply!

Sorry I should of mentioned I am using mac OS X. I ran make install. I am not sure what I am looking for, but here is the link to the output I got from doing 'print cv2.getBuildInformation()': http://pastebin.com/quNQs2qU

LKM gravatar imageLKM ( 2015-10-09 11:17:54 -0600 )edit

"I am using mac OS X" - this is probably totally unrelated.

your output there clearly shows, that the face module got built, and that you're using the opencv3 cv2.pyd that should have it.

call me puzzled.

what happens with a >>> help(cv2) (just the beginning, the submodules section ?)

should look like this:

Help on module cv2:

NAME
    cv2

FILE
    d:\programme\python27\lib\site-packages\cv2.pyd

SUBMODULES
    Error
    aruco
    bgsegm
    bioinspired
    datasets
    detail
    face
    fisheye
    flann
    ml
    motempl
    ocl
    ogl
    optflow
    ppf_match_3d
    ....
berak gravatar imageberak ( 2015-10-09 11:31:12 -0600 )edit

The only difference I get when I run >>> help(cv2) is:

FILE
/usr/local/lib/python2.7/site-packages/cv2.so

Not sure if this explains anything?

LKM gravatar imageLKM ( 2015-10-09 11:41:21 -0600 )edit

Thanks for all of your help, I reinstalled opencv and made it again and I no longer appear to have the issue! I must of done something wrong during the build initially!

LKM gravatar imageLKM ( 2015-10-09 12:07:53 -0600 )edit