Ask Your Question

ru4mj12's profile - activity

2016-12-20 16:28:30 -0500 commented question face.predict error in cv3 python 2.7

Thanks, the help now shows the predict function, and it does work as you pointed out with the confidence removed. Interestingly, the commit shows the fix was done in May, but I built in November and the only instance of face.hpp I have is in the opencv_contrib folder (opencv/opencv_contrib/modules/face/include/opencv2/face.hpp) which doesn't have the fix. The reason I installed the _contrib files was in order to get SIFT.. is it possible that doing so automatically replaced the main line face module? Or given my setup, is there a way to get the confidence value?

2016-12-19 23:09:55 -0500 commented question face.predict error in cv3 python 2.7

Thanks, it reports Version 3.1.0.. but I don't see predict when doing help(cv2.face) or help(cv2.face.createLBPHFaceRecognizer). And according to that thread, it looks like the issue may have been resolved in #638/#6547. Does this mean I need an update? Since everything else works, I'm a little scared of building openCV again, is there an example of how to call predict in python/cv3?

2016-12-19 22:19:35 -0500 asked a question face.predict error in cv3 python 2.7

The following code works in cv2, but neither predict line works in cv3:

recognizer = cv2.face.createLBPHFaceRecognizer(radius=2, neighbors=16, grid_x=3, grid_y=3)
(prediction, conf) = recognizer.predict([i])   #OR..
(prediction, conf) = cv2.face.predict([i])

The attempt to call predict results in either : object is not iterable or object as no attribute 'predict' error

I found some old discussion related to this Face class,

but not sure if it's still relevant or if it's even the same issue I have. I'm pretty new to this, so I think I'm just calling it the wrong way, especially since predict is listed in the cv3 documentation: