Face-and-Emotion-Recognition
Face-and-Emotion-Recognition copied to clipboard
Realtime person's face recognize and can classify emotion using webcam, video or images.
trafficstars
Face and Emotion Recognition
This software recognizes person's faces and their corresponding emotions from a video or webcam feed. Powered by OpenCV, Dlib, face_recognition and Deep Learning.
Demo

Dependencies
- Opencv
- Cmake
- Dlib
- face_recognition
- Keras
Note : If you are facing issues installing dlib in your system then use google collab its comes as pre-installed.
Usage
testfolder contain images or video that we will feed to the model.imagesfolder contain only images of person face to perform face recognition.modelscontain the pre-trained model for emotion classifier.emotion.pycan to run to classify emotions of person's face.face-rec-emotion.pycan recognise faces and classify emotion at a time.- face_recognition library uses the FaceNet Implementation for face recognition.For more details please visit here
python emotion.py
python face-rec-emotion.py
To train new models for emotion classification
- Download the fer2013.tar.gz file from here
- Move the downloaded file to the datasets directory inside this repository.
- Untar the file:
tar -xzf fer2013.tar - Download train_emotion_classifier.py from orriaga's repo here
- Run the train_emotion_classification.py file:
python train_emotion_classifier.py
Deep Learning Model
The model used is from this research paper written by Octavio Arriaga, Paul G. Plöger, and Matias Valdenegro.

Credit
- Computer vision powered by OpenCV.
- Neural network scaffolding powered by Keras with Tensorflow.
- FaceNet Research Paper
- Convolutional Neural Network (CNN) deep learning architecture is from this research paper.
- Pretrained Keras model and much of the OpenCV code provided by GitHub user oarriaga.