I just upgraded my OpenCV version from 2.4 to 3.1. I'm using python with it. Before upgrading, the following code would return the label of the predicted image and the confidence label:
label, confidence = model.predict(test_sample_image)
However, after the upgrade, the above code gives an error:
Traceback (most recent call last):
File "recognize.py", line 45, in <module>
label, confidence = model.predict(test_sample_image)
TypeError: 'int' object is not iterable
meaning that an integer is returned instead of a tuple as before. So how do I get the confidence?
I've think I've found the solution to your problem. Click here
Open the file: opencv_contrib/modules/face/include/opencv2/face.hpp
If you go to line 259 on that file you should find it different than what was in the repositiory
It should just work after that. Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With