paviro / MMM-Facial-Recognition-Tools

Tools to setup and train the facial recognition module for the MagicMirror.
43 stars 23 forks source link

cv2 gave me errors #38

Closed klint-k closed 4 years ago

klint-k commented 4 years ago

I am using this on a lap top to experiment with it. No magic mirror.

python3 capture.py seemed to work ok

Then I tried

python3 train.py

This the results

Using FACE_ALGORITM: 1
Which algorithm do you want to use?
[1] LBPHF (recommended)
[2] Fisherfaces
[3] Eigenfaces
--> 1

Reading training images...
--------------------
Assign label 1 to Klint
--------------------

Read 18 positive images and 400 negative images.

18 images from subject Klint
--------------------

Training model type 1 with threshold 80
Traceback (most recent call last):
  File "train.py", line 115, in <module>
    model = config.model(config.RECOGNITION_ALGORITHM, config.POSITIVE_THRESHOLD)
  File "/root/MMM-Facial-Recognition-Tools/lib/config.py", line 134, in model
    model = cv2.face.createLBPHFaceRecognizer(threshold=thresh)
AttributeError: module 'cv2.cv2' has no attribute 'face'

Do I have to make some file that come with MagicMirror?

randomstring commented 4 years ago

I googled it for you:

https://github.com/opencv/opencv/issues/13848

It's a problem with your Open CV install and not related to this (now deprecated) module.