Skip to content

dhanushkamath/PyEmotionRecognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyEmotionRecognition

A Python project to detect an individual's face and recognize the emotion expressed, given an image.

Getting Started

Prerequisites

The following Python 3 libraries are to be installed (If not already installed) :

  1. OpenCV
  2. numpy
  3. dlib
  4. scikit-Learn
  5. random
  6. glob
  7. math
  8. itertools

Most of the above mentioned libraries can be installed using

sudo pip3 install <library-name>

For installing OpenCV on Ubuntu 16.04, use the link : http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/

Download the dlib predictor that has been used in the project from : http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 and move it to the location in the project 'data/DlibPredictor'

The CK+ dataset has been used for training this model, link : http://www.consortium.ri.cmu.edu/ckagree/

Synopsis

A short description for the use of each python script :

  1. OrganizeData.py : Organizes the images present in the CK+ dataset into their respective emotion folders according to the emotion labels.
  2. DataPreProcess.py : Uses HAAR Cascades to detect faces and crop the organized images.
  3. EmotionClassifier2.py : Trains and saves a Support Vector Machine classifier to classify future images according to emotion.
  4. Model_test2.py : Loads the saved SVM model, detects the face in the given image and predicts the emotion expressed.

Most of the code and the general idea is taken from the link given below: van Gent, P. (2016). Emotion Recognition Using Facial Landmarks, Python, DLib and OpenCV. A tech blog about fun things with Python and embedded electronics. Retrieved from: http://www.paulvangent.com/2016/08/05/emotion-recognition-using-facial-landmarks/

About

A Python project to recognize the emotion expressed on an individual's face, given an image.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages