1

I’m getting AttributeError: module ‘cv2.face’ has no attribute ‘createLBPHFaceRecognizer’ for the following code snippet.

import cv2
cascade = "haarcascade_frontalface_default.xml"
face_Cascade = cv2.CascadeClassifier(cascade)
recog = cv2.face.createLBPHFaceRecognizer()

in line 4:

recog = cv2.face.createLBPHFaceRecognizer()

can you please help me out? alternatives for this code snippet is appriciated.

Answered question