Skip to content

thebatclaudio/dont-worry-be-happy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Don't worry, be happy 😀

Face detection + Age/Gender Recognition + Emotion Recognition with Python & Tensorflow

Installation

Clone the repository.

Install these dependencies with pip3 install <module name>

  • tensorflow
  • numpy
  • scipy
  • imageio
  • opencv-python
  • pillow
  • pandas
  • matplotlib
  • h5py
  • keras

Compile your config.json inside config folder.

Now, you can run the project: python3 app.py

or using pm2.

Models

In constants.py you can find the models that I used to detect faces, age, gender and emotions. I didn't include these models in my repository, but you can download them:

To train new models for emotion classification

  • Download the fer2013.tar.gz file from here
  • Move the downloaded file to the datasets directory inside this repository.
  • Untar the file: tar -xzf fer2013.tar
  • Download train_emotion_classifier.py from orriaga's repo here
  • Run the train_emotion_classification.py file: python3 train_emotion_classifier.py

Credits

  • Computer vision powered by OpenCV.
  • Neural network scaffolding powered by Keras with Tensorflow
  • Convolutional Neural Network (CNN) deep learning architecture is from this research paper
  • Pretrained Keras model and much of the OpenCV code provided by GitHub user oarriaga
  • Emotion recognition based on petercunha/Emotion
  • Age and gender recognition based on Tony607/Keras_age_gender