Realtime Human Emotion Analysis From facial expressions. It uses a deep Convolutional Neural Network. The model used achieved an accuracy of 63% on the test data. The realtime analyzer assigns a suitable emoji for the current emotion.
Model implementation was done in keras.
The model prediction for the given frame was Neutral which is evident from the picture.
facial Emotions.ipynb
:
Jupyter notebook with well documented code explaining model preparation from start to training. Can be used for retraining the model.
main.py
: main python
webcam_utils
:
Code for realtime emotion detection from face
prediction_utils
:
Code for doing prediction on image saved on disk
data_prep
:
Code for preparing dataset for training
preprocess.py
:
Code for saving images from csv file
There are two options:
- Realtime emotion detection, for this run:
python main.py emo_realtime
- Emotion detection using image path, for this run:
python main.py emo_path --path <image path>
e.g:python main.py emo_path --path saved_images/2.jpg
If you don't want to specify path then just save the image as "1.jpg" inside saved_images folder
and run:python main.py emo_path
- Dataset used was from Kaggle fer2013 Challenge Challenges in Representation Learning: Facial Expression Recognition Challenge
- Emojis used were from https://emojiisland.com/