nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

CV2 error on encode #8

Closed SdeGeata closed 5 years ago

SdeGeata commented 5 years ago

Hello Nischi;

So I've finally managed to install Open CV 4.1 and all its dependancies, as well as your new module. I am having issues on the encoding, here's the output:

$ python3 encode.py -i ../dataset/ -e encodings.pickle -d hog [INFO] quantifying faces... [INFO] processing image 1/40 [INFO] processing image 2/40 [INFO] processing image 3/40 [INFO] processing image 4/40 [INFO] processing image 5/40 [INFO] processing image 6/40 [INFO] processing image 7/40 [INFO] processing image 8/40 [INFO] processing image 9/40 [INFO] processing image 10/40 [INFO] processing image 11/40 [INFO] processing image 12/40 [INFO] processing image 13/40 Traceback (most recent call last): File "encode.py", line 40, in <module> rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.1.0) /home/pi/opencv-4.1.0/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

I thought it might be one of the images that was already greyscale, that one was removed - still no difference. It always stops on lucky 13 too.

SdeGeata commented 5 years ago

I found the issue. I dumped the images on my Pi from my Mac via Netatalk - so it reads and writes as though its another drive on the network. Mac writes all kinds of hidden files ".AppleDouble" and ".DS_Store". Once those were removed, I got the correct count on images to be encoded and it encoded all the way through without errors. The encodings.pickle database is generated.

This issue can be closed.