← Open Source
atulapra

Emotion-detection

Real-time Facial Emotion Detection using deep learning.

ApplicationsOtherPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
1.36k
Stars
550
Forks
+0
This week
3
Contributors
Created 2017-08-06 · Updated 2026-10-12 · #10582 today
Top developers
atulaprakarthikkec

atulapra/Emotion-detection is ranked 10,582 with 1,359 stars.

Same-category comparison

atulapra/Emotion-detection is ranked 10,582 among these 8 peers; fofr/cog-face-to-many is ranked 10,583.

Same-category comparison
NameRankMetrics
Kuingsmile/word-GPT-Plus10,555
Language:
TypeScript
Stars:
1,368
Forks:
231
Description:
Word GPT Plus is a word add-in which integrates the AI&Agent into Microsoft Word.
LuckyHookin/edge-TTS-record10,564
Language:
HTML
Stars:
1,366
Forks:
173
Team-Commonly/commonly10,572
Language:
TypeScript
Stars:
1,363
Forks:
189
79E/ChatGpt-Web10,575
Language:
TypeScript
Stars:
1,361
Forks:
438
Description:
A commercially-viable ChatGpt web application built with React.
fofr/cog-face-to-many10,583
Language:
Python
Stars:
1,359
Forks:
205
Description:
Turn any face into a video game character, pixel art, claymation, 3D or toy.
mishl-dev/Discord-AI-Chatbot10,586
Language:
Python
Stars:
1,358
Forks:
422
Description:
This Discord chatbot is incredibly versatile. Powered incredibly fast Groq API.
zanllp/infinite-image-browsing10,588
Language:
Vue
Stars:
1,358
Forks:
180
Description:
A full-featured image/video management app with AI-powered organization and semantic search. Supports metadata from SD-webui, ComfyUI, Fooocus, NovelAI, StableSwarmUI, and more. Available as standalone app, SD-webui extension, or library.
yinguobing/head-pose-estimation10,593
Language:
Python
Stars:
1,357
Forks:
293
Description:
Realtime human head pose estimation with ONNXRuntime and OpenCV.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryApplications
SubcategoryOther
Stars1,359
Forks550
Contributors3
Created date2017-08-06
Updated date2026-10-12
Stars in 1 day0
Stars in 7 days0
Rank10,582
Previous rank10,572
Rank change-10
7-day stars rank12,677
Previous 7-day stars rank12,703
7-day stars rank change26
Total stars rank8,780
Previous total stars rank8,771
Total stars rank change-9
CountryUSA
README summary

Emotion detection using deep learning Introduction This project aims to classify the emotion on a person's face into one of **seven categories**, using deep convolutional neural networks. The model is trained on the **FER-2013** dataset which was published on International Conference on Machine Learning (ICML). This dataset consists of 35887 grayscale, 48x48 sized face images with **seven emotions** - angry, disgusted, fearful, happy, neutral, sad and surprised. Dependencies Python 3, OpenCV, Tensorflow To install the required packages, run . Basic Usage

The repository is currently compatible with and makes use of the Keras API using the library. First, clone the repository and enter the folder Download the FER-2013 dataset inside the folder. If you want to train this model, use: If you want to view the predictions without training again, you can download the pre-trained model from here and then run: The folder structure is of the form: src: data (folder) (file) (file) (file) This implementation by default detects

emotions on all faces in the webcam feed. With a simple 4-layer CNN, the test accuracy reached 63. Data Preparation (optional) 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. 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 file which can be used for reference. Algorithm 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. References "Challenges in Representation Learning: A report on three

machine learning contests. " I Goodfellow, D Erhan, PL Carrier, A Courville, M Mirza, B Hamner, W Cukierski, Y Tang, DH Lee, Y Zhou, C Ramaiah, F Feng, R Li, X Wang, D Athanasakis, J Shawe-Taylor, M Milakov, J Park, R Ionescu, M Popescu, C Grozea, J Bergstra, J Xie, L Romaszko, B Xu, Z Chuang, and Y.

Frequently asked questions

How many stars and forks are recorded?

atulapra/Emotion-detection has 1,359 stars and 550 forks.

What is the repository rank?

atulapra/Emotion-detection is ranked 10,582.

What language and category are recorded?

atulapra/Emotion-detection has 1,359 stars, uses Python and belongs to Applications.

Which repository is closest in rank?

atulapra/Emotion-detection is compared with fofr/cog-face-to-many, ranked 10,583 with 1,359 stars.

README

Emotion detection using deep learning

Introduction

This project aims to classify the emotion on a person's face into one of seven categories, using deep convolutional neural networks. The model is trained on the FER-2013 dataset which was published on International Conference on Machine Learning (ICML). This dataset consists of 35887 grayscale, 48x48 sized face images with seven emotions - angry, disgusted, fearful, happy, neutral, sad and surprised.

Dependencies

  • Python 3, OpenCV, Tensorflow
  • To install the required packages, run pip install -r requirements.txt.

Basic Usage

The repository is currently compatible with tensorflow-2.0 and makes use of the Keras API using the tensorflow.keras library.

  • First, clone the repository and enter the folder
git clone https://github.com/atulapra/Emotion-detection.git
cd Emotion-detection
  • Download the FER-2013 dataset inside the src folder.

  • If you want to train this model, use:

cd src
python emotions.py --mode train
  • If you want to view the predictions without training again, you can download the pre-trained model from here and then run:
cd src
python emotions.py --mode display
  • The folder structure is of the form:
    src:

    • 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 reached 63.2% in 50 epochs.

Data Preparation (optional)

  • 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.

  • 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.

Algorithm

  • 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.

References

  • "Challenges in Representation Learning: A report on three machine learning contests." I Goodfellow, D Erhan, PL Carrier, A Courville, M Mirza, B Hamner, W Cukierski, Y Tang, DH Lee, Y Zhou, C Ramaiah, F Feng, R Li,
    X Wang, D Athanasakis, J Shawe-Taylor, M Milakov, J Park, R Ionescu, M Popescu, C Grozea, J Bergstra, J Xie, L Romaszko, B Xu, Z Chuang, and Y. Bengio. arXiv 2013.
Nearby in the ranking
Similar items