Skip to content

Repository files navigation

Human-facial emotion analysis and recognition with CNN

This project will detect 7 types of facial emotion, angry, disgust, fear, happy, neutral, sad, surprise.

Packages that I have used and need to be installed

  • pip install numpy
  • pip install opencv-python
  • pip install keras
  • pip3 install tensorflow
  • pip install pillow
  • I have also used HaarCascade to make boundary around the face.

The FER2013 dataset can be downloaded from the link below

Train Emotion detector

  • used face expression images in the FER2013 Dataset
  • Run the command --> python TrainEmotionDetector.py ; to train the ML Model

It took around 1hour 45minutes for my laptop with Ryzen 7 processor, 16gb RAM and Nvidia GeForce GTX 1650 GPU. After Training, we will find the trained model structure and weights are stored in the project directory as:- emotion_model.json emotion_model.h5

Now we can copy these two files created, and paste in model folder in the project directory.

Run your emotion detection test file

Run the command --> python TestEmotionDetector.py ; to see the output. I have made 2 options to view the result(which can be seen in TestEmotionDetector.py file,

About

This is a project on Human-facial emotion analysis and recognition using Machine Learning and CNN (Convolution Neural Network)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages