Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msiddhu/emotion-detection
A emotion detection tool based on TensorFlow and OpenCV
https://github.com/msiddhu/emotion-detection
accuracy dataset emotion-detection faces numpy opencv python tensorflow tensorflow-models webcam-feed
Last synced: 3 months ago
JSON representation
A emotion detection tool based on TensorFlow and OpenCV
- Host: GitHub
- URL: https://github.com/msiddhu/emotion-detection
- Owner: msiddhu
- License: mit
- Created: 2020-01-29T07:09:47.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T10:05:06.000Z (over 3 years ago)
- Last Synced: 2024-10-11T08:43:43.804Z (4 months ago)
- Topics: accuracy, dataset, emotion-detection, faces, numpy, opencv, python, tensorflow, tensorflow-models, webcam-feed
- Language: Python
- Homepage:
- Size: 21.4 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Emotion-detection
## Introduction
This project aims to classify the emotion on a person's face into one of **seven categories**, using deep convolutional neural networks. This repository is an implementation of [this](https://github.com/msiddhu/Emotion-detection/blob/master/ResearchPaper.pdf) research paper. The model is trained on the **FER-2013** dataset which was published on International Conference on Machine Learning (ICML). Face images with **seven emotions** - angry, disgusted, fearful, happy, neutral, sad and surprised.
## Dependencies
* Python 3, [OpenCV 3 or 4](https://opencv.org/), [Tensorflow 1 or 2](https://www.tensorflow.org/)
* To install the required packages, run `pip install -r requirements.txt`.## Usage
The repository is currently compatible with `tensorflow-2.0` and makes use of the Keras API using the `tensorflow.keras` library.
* pretrained model link-
* The folder structure is of the form:
Tensorflow:
* data (folder)
* `emotions.py` (file)
* `haarcascade_frontalface_default.xml` (file)
* `model.h5` (file)* This implementation by default detects emotions on all faces in the webcam feed.
* With a simple 4-layer CNN, the test accuracy peaked at around 50 epochs at an accuracy of 63.2%.
![Accuracy plot](accuracy.png)
## Algorithm
* First, we use **haar cascade** 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.
* The emotion with maximum score is displayed on the screen.