amineHorseman / facial-expression-recognition-using-cnn

Deep facial expressions recognition using Opencv and Tensorflow. Recognizing facial expressions from images or camera stream
GNU General Public License v3.0
445 stars 141 forks source link

Run model on test image using predict.py #9

Closed ajaysh2193 closed 5 years ago

ajaysh2193 commented 5 years ago

Hi, I am facing an issue when I am running python predict.py --image pic.jpg to test the prediction on a random image. I downloaded the angry face image randomly from internet and try to check the model predicition. But I am getting error as below (please check screenshot). Your help would be much appreciated! error

Regards, Ajay Sharma

amineHorseman commented 5 years ago

Hi @ajaysh2193

It seems the image you tried is bigger than what the cnn expected Please add the following line in the file predict.py just before line 67:

image = cv2.resize(image, (NETWORK.input_size, NETWORK.input_size))