Giter Club home page Giter Club logo

emotionrecognition's Introduction

EmotionRecognition GitHub release  Donate  Follow 

Emotion recognition (Angry, Disgust, Fear, Happy, Sad, Surprise, Neutral) using CNN with Python 3.x

EmotionRecognition in action.

Usage:

  1. Move to the project directory.

  2. Make sure you have all the libraries required by running the following command on your cmd/terminal.

    pip install -r requirements.txt
    
  3. The dataset to train and test our CNN model will be extracted from a CSV file with the following description:

    • The data consists of 48x48 pixel grayscale images of faces.

    • The faces have been automatically registered so that the face is more or less centered and occupies about the same amount of space in each image.

    • The task is to categorize each face based on the emotion shown in the facial expression into one of seven categories (0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral).

    • emotionData.csv contains two columns, "emotion" and "pixels".

    • The "emotion" column contains a numeric code ranging from 0 to 6, inclusive, for the emotion that is present in the image.

    • The "pixels" column contains a string surrounded in quotes for each image.

    • The contents of this string a space-separated pixel values in row-major order.

  4. This program uses your phone's camera as its video source. To make that work you'll have to download the IP Webcam application from the Google Play Store. After you have the application downloaded scroll to the bottom and press Start Server which begins to stream the video. Once the video starts to stream you will see the IPv4 address displayed on the screen of the mobile application. Copy that IP address and go to main.py -> EmotionRecognition class -> init and set the URL to the IP Address mentioned on IP Webcam application. Note: Your PC and mobile should be connected to the same wi-fi network for this to work.

  5. Finally, run the main.py file to start execution.

    Note: Make sure the emotionData.csv dataset file is in the project directory and also make sure the video is streaming before running main.py [4]

    python main.py
    

Output:

alt text

alt text

alt text

alt text

alt text

Built With:

  • Keras - The Python Deep Learning library.
  • Pandas - Python Data Analysis Library.
  • NumPy - The fundamental package for scientific computing with Python.
  • OpenCV - A library of programming functions mainly aimed at real-time computer vision.
  • PIL - Python Imaging Library is a free library for the Python programming language that adds support for opening, manipulating, and saving many different image file formats.
  • Crayons - TextUI colors for Python.

emotionrecognition's People

Contributors

skumar0009 avatar arpith-s avatar

Stargazers

 avatar

Watchers

 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.