Emotion-Detector to detect angry,sad,disgust emotions.
- Python 3, OpenCV, Tensorflow
- To install the required packages, run
pip install -r requirements.txt
.
- The original FER2013 dataset in Kaggle is available as a single csv file. I had converted into a dataset of images in the PNG format for training/testing and provided this as the dataset in the previous section.
- In case you are looking to experiment with new datasets, you may have to deal with data in the csv format. I have provided the code I wrote for data preprocessing in the
dataset_prepare.py
file which can be used for reference. - Download the FER-2013 dataset from here and unzip it inside the
src
folder. This will create the folderdata
. - If you want to train this model, use:
- Reference
- First, the haar cascade method is used to detect faces in each frame of the webcam feed.
- The region of image containing the face is resized to 48x48 and is passed as input to the CNN.
- The network outputs a list of softmax scores for the seven classes of emotions.
- The emotion with maximum score is displayed on the screen.