selvakarna / -Face-emotion-recognition

Face emotion recognition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emotion-detection

Dependencies

Usage

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

  • If you want to train this model or train after making changes to the model, use python emotions.py --mode train.

  • 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

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

  • The network outputs a list of softmax scores for the seven classes.

  • The emotion with maximum score is displayed on the screen.

Sample Output: Neutral image

Angry image

Sad image

About

Face emotion recognition


Languages

Language:Python 100.0%