liminze / Real-time-Facial-Expression-Recognition-and-Fast-Face-Detection

Real-time facial expression recognition and fast face detection based on Keras CNN. Training and testing on both Fer2013 and CK+ facial expression data sets have achieved good results. The speed is 78 fps on NVIDIA 1080Ti. If only face detection is performed, the speed can reach 158 fps. Finally, an emotional monitoring system was developed based on it.
56 stars 15 forks source link

cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3718: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' #1

Open AyeshaM67 opened 5 years ago

AyeshaM67 commented 5 years ago

Hi! I am kinda new to programming and whenever I try to run train_again_emotion.py, I get the following error: File "train_again_emotion.py", line 81, in crop_face=True File "K:\ayesha 1\Real-time-Facial-Expression-Recognition-and-Fast-Face-Detection-master\Real-time-Facial-Expression-Recognition-and-Fast-Face-Detection-master\load_retrain_data.py", line 33, in load_retrain_data image = cv2.resize(image, image_size, interpolation=cv2.INTER_AREA) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3718: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

Could you please tell me, why this is happening? Thanks in advance :)

liminze commented 5 years ago

Hello, your problem should be reading image failure, you should check which step the problem occurred. For example, you can check if your image format is ‘png’. In fact, the operation of crop_face should be set according to your dataset. If your dataset has a large proportion of face areas, you don't need the crop_face operation (crop_face=False).

snowalala commented 5 years ago

Hi! I have the same problem, and I use the CK+. I don't know how to solve it, please help me. Thanks.

AyeshaM67 commented 5 years ago

Thanks for the response @liminze! I will try that :)