model = cv2.face.LBPHFaceRecognizer_create() AttributeError: module 'cv2' has no attribute 'face'

0

Cześć !!
Mam problem z atrybutami

    model = cv2.face.LBPHFaceRecognizer_create()
AttributeError: module 'cv2' has no attribute 'face'

program

	print ("Training model...")
	model = cv2.face.LBPHFaceRecognizer_create() 
	#model = cv2.createEigenFaceRecognizer()
	model.train(np.asarray(faces), np.asarray(labels))

Podczas instalacji pip3 install opencv-contrib-python na RP 4

wisi

Building wheels for collected packages: opencv-contrib-python
  Building wheel for opencv-contrib-python (pyproject.toml) ... |

0

Sprobuj zainstalować condą.
https://anaconda.org/anaconda/python

0

w nowej wersji Opencv trzeba zmienić odwołanie do funkcji:

model = cv2.face.EigenFaceRecognizer_create()

oraz
mean = model.getMean().reshape(faces[0].shape)

cv2.imwrite(MEAN_FILE, normalize(mean, 0, 255, dtype=np.uint8))

eigenvectors = model.getEigenVectors()

1 użytkowników online, w tym zalogowanych: 0, gości: 1