This repository contains a real-time face detection and emotion classification model. The face detection utilizes MTCNN and OpenCV, while the emotion classification model is based on a Convolutional Neural Network (CNN) architecture called VGGFace, with weights trained on the FER2013 dataset. This modification is built on top of Parkhi et. al 2023.
The model operates on the VGGFace architecture, a CNN designed specifically for face recognition tasks.
- The emotion classification code has been optimized for better performance and readability.
- Real-time radar plot integration for visualizing the probabilities of different emotions.
- Improved face detection and emotion classification accuracy.
- Removal of the display of the cropped image from the webcam feed.
- Added a radar plot with a circular border and emotion labels, positioned center-left on the video frame.
-
Clone this commit to your local machine using
git clone https://github.com/travistangvh/emotion-detection-in-real-time.git -
Install these dependencies with pip install
pip install -r ../REQUIREMENTS.txt -
Download pretrained model and weight
trained_vggface.h5from here. -
Place
trained_vggface.h5into../datasets/trained_models/. -
Run
emotion_webcam_demo.pyusingpython3 emotion_webcam_demo.py
-
Download the fer2013.tar.gz file from here
-
Move the downloaded file to the
../datasets/raw/directory inside this repository. -
Untar the file:
tar -xzf fer2013.tar -
Ensure that the file
../datasets/raw/fer2013.csvexists -
Run the
training_emotion_classification.pyfilepython3 training_emotion_classifier.py
- Deep Face Recognition by Parkhi et. al.
