The following repository is a real-time face detection and emotion classification model.
The face detection is powered by MTCNN and openCV. The emotion classification model is a built on an CNN architecture called VGGFace with weights trained on the fer2013 dataset.
The model is trained on a CNN architecture called VGGFace.
-
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.h5
from here. -
Place
trained_vggface.h5
into../datasets/trained_models/
. -
Run
emotion_webcam_demo.py
usingpython3 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.csv
exists -
Run the
training_emotion_classification.py
filepython3 training_emotion_classifier.py
- Deep Face Recognition by Parkhi et. al.