a514514772 / Real-Time-Facial-Expression-Recognition-with-DeepLearning

A real-time facial expression recognition system with webcam streaming and CNN
MIT License
257 stars 113 forks source link

I am getting the following error #1

Closed akshay-goel closed 6 years ago

akshay-goel commented 7 years ago

I followed the steps as mentioned in the readme file but I am getting the following error please help.

Traceback (most recent call last): File "webcam_detection.py", line 5, in import cv2 ModuleNotFoundError: No module named 'cv2'

a514514772 commented 7 years ago

Hi, maybe you didn't install opencv. You can check it by "conda list" if my memory was correct. :)

Thanks, Hui-Po

2017年5月29日 下午5:33,"Akshay Goel" notifications@github.com寫道:

I followed the steps as mentioned in the readme file but I am getting the following error please help.

Traceback (most recent call last): File "webcam_detection.py", line 5, in import cv2 ModuleNotFoundError: No module named 'cv2'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/a514514772/Real-Time-Facial-Expression-Recognition-with-DeepLearning/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AJwS_mqJx-j4iV6MweLkXgWJB0AGyxogks5r-pECgaJpZM4NpGNl .

akshay-goel commented 7 years ago

I have installed opencv.I used the first command as mentioned in the readme file and I didn't got any error.

a514514772 commented 7 years ago

Could you please share me more information ?

It will help if you provide me more information such as the screen shot when error occurred, the installation flow you used or which packages you have installed.

thanks, Hui-Po

2017-05-29 18:11 GMT+08:00 Akshay Goel notifications@github.com:

I have installed opencv.I used the first command as mentioned in the readme file and I didn't got any error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/a514514772/Real-Time-Facial-Expression-Recognition-with-DeepLearning/issues/1#issuecomment-304625796, or mute the thread https://github.com/notifications/unsubscribe-auth/AJwS_iJWPOUPtVbAFIaO1-IYnkoyJsceks5r-pnagaJpZM4NpGNl .

akshay-goel commented 7 years ago

screenshot from 2017-05-30 10-06-33 The previous error got resolved when I used the second command given in the read me file. Now I am getting different errors and I have attached the screenshot of it.Please find it.

a514514772 commented 7 years ago

Please refer to this part: default

Keras uses tensorflow as the backend by default, but I used theano as the backend when I implemented this project. To figure out this problem, you can modify the configuration file as the document mentioned, if there is no configuration file, just create one by yourself.

akshay-goel commented 7 years ago

Done Thank you.

akshay-goel commented 7 years ago

Now I am getting the following error. attached the screenshot. Can you also please explain the input and output produced by the program or it will use the system's webcam. screenshot from 2017-05-30 16-22-58

a514514772 commented 7 years ago

The program will launch your camera first, and then crop the detected face from the frame captured by your camera. It also resizes the cropped face to (48, 48), and take it as the input of the pre-trained model. In the end, the model outputs a list which contains the probability of six type of emotions and the main program transform it into corresponding emoticons.

edit: The main program will choose the emotion with the highest probability as user's current emotion. According to that, the main program generates the corresponding emoticon.

akshay-goel commented 7 years ago

I think program is not able to open webcam please see the screenshot in the previous post and tell me what to do.

htahir1 commented 7 years ago

I am getting the same problem as akshay. Please check whether the architecture is configured properly?

a514514772 commented 7 years ago

In my environment, it works well. I guess that's the problem about opencv or your own webcam, not the architecture of model.

I'll check if this project can work well in different environment, but not these days. Before that, please check the opencv documents by yourself.

a514514772 commented 7 years ago

Hey guys, I figured out it.

The main problem is the version of Keras. I used Keras 1 when I implemented this project, but it changed some setting when it updates to Keras2. Precisely, you should set the image_data_format instead of image_dim_ordering in the ~/.keras/keras.json configuration file.

Anyway, I have updated both codes and README file to deal with that. You can check it now.

akshay-goel commented 7 years ago

still there is some problem ,I am getting the same error.

a514514772 commented 7 years ago

@akshay-goel which version of Keras are you using ? did you re-clone the project and set the configuration file properly ?

akshay-goel commented 7 years ago

I didn't re-clone it.Thank you for your support,hopes it works out.

a514514772 commented 7 years ago

Good, maybe you can try that again and tell me if it works well.

Atlas7 commented 6 years ago

did you do a source activate env-name to activate the conda environment? I got mine working. did all the conda install via the conda-forge channel

conda create -n py34-emotion python=3.4
source activate py34-emotion
conda install scikit-learn opencv pandas h5py keras
subl ~/.keras/keras.json    (to copy and paste the keras 2 template)

then go to the webcam directory. do a

python webcam_detection.py

Then you will see a stream of emotion probabilities (highest one)

stonycat commented 6 years ago

git1

OK, I success after reinstall opencv use "conda -c menpo opencv"