-1

I'm trying to follow a recent Python OpenCV tutorial and it's not finding the .face class. I've tried everything on StackOverflow. Before marking this as a duplicate, please see what I've already tried.

I've tried to pip install opencv-contrib-python and all the other cv2. classes work except cv2.face is not recognized. I've installed and uninstalled opencv-python and opencv-contrib-python and restarted my computer. I also tried to use this link about using the CMake gui but I have no idea what I'm doing and I get an error when I try to do it. https://github.com/opencv/opencv_contrib

import cv2

recognizer = cv2.face_lbphfacerecognizer.create()

My PyCharm errors before I've even finished typing face and the error pops up immediately. Cannot find reference 'face' in init_.py

Serenity
  • 35,289
  • 20
  • 120
  • 115
Brandon Jacobson
  • 139
  • 3
  • 10

1 Answers1

0

Unresolved reference "cv2" inside cv2 (cv2.cv2) According to these answers, this is a bug in pycharm. You can find the answer here or just ignore the "error" and do without autocompletion.

Hùng Nguyễn
  • 599
  • 8
  • 24
  • I broke the first rule in troubleshooting and I tried many things all at once so I'm not sure what I did to actually fix it. I'm going to mark this though because you may be right and there's awesome information in your answer which I'm sure I'll need in the future. Thank you so much! – Brandon Jacobson Aug 08 '19 at 10:44