Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 2.03 KB

README.md

File metadata and controls

54 lines (41 loc) · 2.03 KB

webCamEmocognizer

A cool emotion detector using your laptop/desktop webcam.

Data resource

The data for this work is taken from the kaggle competiotion: Challenges in Representation Learning: Facial Expression Recognition Challenge https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge

The dataset provided in the competion consists of gray scale images which are 48 x 48 in dimension and the corresponding labels consisting of 7 emotions.

We are using a simple convolution neural network to classify the images.

Then, we are using opencv to extract 48 x 48 dimension images using the webcam and classifying them using our model.

Requirements

The code is written in python 2.7.9
Keras (1.2.1)
numpy
pandas
theano (0.8.2)
cv2 (1.0)

Data

The data consists of scaled images from the kaggle competion kept in the data folder and also the labels in .npy format.

Training and running the tool

To train using the data, use the script trainCNN.py
Firstly, create the image data scaled, run the script
python ./genScaledDat.py
check if the file Scaled.bin.npy is generated in the data folder.
Then run the following:
python ./trainCNN.py

to run the detection using the training models run:
python ./DetectEmotion.py

Sample

Let's see if it likes beer:

Todos

A lot

  1. Clean up the code
  2. Update Keras backend and use OpenCv 3.0
  3. If anyone wants to contribute, plase feel free to contact.

N.B.

This project was part of my Master's thesis, the thesis is also added in the documents folder.

References:

[1] Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks.
[2] Shima Alizadeh, Azar Fazel. Convolutional Neural Networks for Facial Expression Recognition.
[3] https://codeplasma.com/2012/12/03/getting-webcam-images-with-python-and-opencv-2-for-real-this-time/