Jitendarpal Singn
Jitendarpal Singn

Reputation: 55

AttributeError: module 'cv2.cv2' has no attribute 'createFisherFaceRecognizer'

I have installed opencv-python and then tried this piece of code:

*

import cv2
import glob as gb
import random
import numpy as np
#Emotion list
emojis = ["neutral", "anger", "contempt", "disgust", "fear", "happy", "sadness", "surprise"] 
 #Initialize fisher face classifier
fisher_face = cv2.createFisherFaceRecognizer()

*

But I was getting this error. I tried installing opencv-contrib-python but again it gave me the same issue.Kindly help me.

Thanks in advance!

Upvotes: 0

Views: 2860

Answers (1)

eshirima
eshirima

Reputation: 3867

Chances are you are using OpenCV 3.3 and according to their documentation, this module was moved under face. You can access it with cv2.face.FisherFaceRecognizer_create()

Upvotes: 1

Related Questions