Coder Social home page Coder Social logo

varsharamanujam / emotion_detection_with_cnn Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 16.83 MB

A Convolutional Neural Network (CNN) based solution for emotion detection using the FER2013 dataset. The model is trained to recognize various facial expressions, including anger, disgust, fear, happiness, sadness, surprise.

Python 100.00%

emotion_detection_with_cnn's Introduction

Emotion_detection_with_CNN

emotion_detection

This project aims to detect human emotions using Convolutional Neural Networks (CNN). The emotion detection model is trained on the FER2013 dataset and can recognize seven different emotions: Angry, Disgusted, Fearful, Happy, Neutral, Sad, and Surprised.

Prerequisites

Make sure you have the following packages installed:

pip install numpy
pip install opencv-python
pip install keras
pip3 install --upgrade tensorflow
pip install pillow

Dataset

Download the FER2013 dataset from the link below and place it in the data folder under your project directory:

Training the Emotion Detector

Train the emotion detector with all face expression images in the FER2013 Dataset using the following command:

python TrainEmotionDetector.py

Note: Training may take several hours depending on your processor. (On an i7 processor with 16 GB RAM, it may take around 4 hours.)

After training, the trained model structure and weights will be stored in your project directory as emotion_model.json and emotion_model.h5.

Copy these two files and create a model folder in your project directory, then paste them inside.

Testing the Emotion Detector

Run your emotion detection test file using:

run your emotion detection test file

python TestEmotionDetector.py

This script uses the trained model to perform emotion detection on test images, generating a confusion matrix and classification report.

emotion_detection_with_cnn's People

Contributors

varsharamanujam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.