Code Monkey home page Code Monkey logo

emotion-recognition's Introduction

Emotion-recognition

Real time emotion recognition with Keras CNN and OpenCv. Keras is used to train the emotion classification model on face and OpenCv to make simple face detection using Haarcascade classifier.

Model has been trained using google colab : https://colab.research.google.com/, it's a cloud service which provides free GPU

Dependencies

  • Keras
  • Seaborn
  • Sklearn
  • OpenCv

Install dependencies :

pip install -r requirements.txt

Docker

Real time emotion recognition can be run from docker. First, build the image :

docker build -t emotion-recognition .

Add X11 authority :

xhost + local:docker

Run the project with pre-trained model :

docker run --privileged --device=/dev/video0 -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY emotion-recognition

Usage

To predict face emotion from webcam's frame:

python predict_webcam.py

To predict face emotion from local image

python predict_image.py -p path_to_image:

Dataset description

The model has been trained using fer2013 dataset which is composed of 35887 samples splited between 7 classes:

  • Classe 0 : Angry 4593 images
  • Classe 1 : Disgust 547 images
  • Classe 2 : Fear 5121 images
  • Classe 3 : Happy 6077 images
  • Classe 4 : Sad 6077 images
  • Classe 5 : Surprise 4002 images
  • Classe 6 : Neutral 6198 images

hi hi

All samples are 48x48 grayscale face images

Model evaluation

  • Accuracy :64,59 % on validation set

hi hi

emotion-recognition's People

Contributors

fszta avatar

Watchers

James Cloos avatar

Forkers

tafsuttagnit

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.