ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.85k stars 13.43k forks source link

Assertion failed (ssize.width > 0 && ssize.height > 0) in resize after recompiling dlib #496

Open netrosec opened 6 years ago

netrosec commented 6 years ago

Description

I recompiled dlib to compensate for my caveman cpu which doesn't support AVX instructions. Afterwards I run the face_rec_webcam_faster and i'm met with the error below

What I Did

usr/bin/python3.5 "/home/deeplearning/Desktop/face_recognition examples/facerec_from_webcam_faster.py"

`OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /home/deeplearning/opencv-3.2.0/modules/imgproc/src/imgwarp.cpp, line 3492
Traceback (most recent call last):
  File "/home/deeplearning/Desktop/face_recognition examples/facerec_from_webcam_faster.py", line 31, in <module>
    small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
cv2.error: /home/deeplearning/opencv-3.2.0/modules/imgproc/src/imgwarp.cpp:3492: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize`
Process finished with exit code 1
netrosec commented 6 years ago

@ageitgey It's been 21 days since i opened this issue but still no assistance. A little help please? At first it appeared the cv.2 was capturing empty frames from my webcam, but then i ran the VM on a more advanced computer and it's the same error i'm getting. I've not been able to test the facial recognition since last year. I'm desperate for a solution. Thanks

ageitgey commented 6 years ago

Sorry for missing this, but this has been asked many times. Check out the search for the previous answers: https://github.com/ageitgey/face_recognition/search?q=OpenCV+Error%3A+Assertion+failed+%28ssize.width+%3E+0+%26%26+ssize.height+%3E+0%29&type=Issues

The issue is most likely that your Webcam just isn't working with OpenCV. That could be because the webcam isn't working at all or it could be an issue specific to it talking to OpenCV (or how OpenCV was compiled). If you are running inside a VM, make sure your vm host (like VM Ware) is properly set up to expose the camera inside the VM and that other video applications inside the VM can access and see use camera correctly. Run a camera viewer app and make sure that works before doing anything else.

I know it's frustrating when things don't work and I wish I had a more specific answer for you. Check out the comments on those issues in the search. There are some good tips about how to debug this and how some people had to re-compile OpenCV to get it to work. But unfortunately this problem is somewhat specific to your computer so there isn't one answer I can give you that will definitely fix it. :(

netrosec commented 6 years ago

I'll do whatever is needed to get it working. Thanks for pointing me in the right direction. I'm Looking at the search thread now.