OpenCV: AttributeError: module 'cv2' has no attribute 'face'

后端 未结 7 1880
刺人心
刺人心 2020-12-21 12:14

I am creating a face recognition system using Python and OpenCV on these versions:

  • Python 3.6.2 :: Anaconda custom (64-bit)
  • Anaconda 4.3.23
  • O
7条回答
  •  一个人的身影
    2020-12-21 12:25

    While I was looking for the same solution, I tried out many methods which don't work well with successfully installing OpenCV along with the extra modules i.e., OpenCV Contrib.

    Apparently, while using pip install opencv-python windows platforms usually download only OpenCV without the extra modules!

    What works, is stable and easy to install:

    1. Download the integrated 'whl' file containing both OpenCV and it's Contrib files, which would be like 'opencv_python‑3.4.3+contrib‑cp36‑cp36m‑win_amd64.whl' which can be downloaded from here.
    2. Install using pip install

    I have tried other methods which are unreliable such as the solution suggested by @RoyaumeIX, however ended up with failure.

    So is it with using

    pip install opencv
    pip install opencv-contrib
    

    Installing opencv-contrib does not properly register the opencv package.

    I strongly suggest that you directly download the official whl file and install it.

提交回复
热议问题