Need help with face_classification?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

oarriaga
5.0K Stars 1.5K Forks MIT License 147 Commits 47 Opened issues

Description

Real-time face detection and emotion/gender classification using fer2013/imdb datasets with a keras CNN model and openCV.

Services available

!
?

Need anything else?

Contributors list

This repository is deprecated for at TF-2.0 rewrite visit:

https://github.com/oarriaga/paz


Face classification and detection.

Real-time face detection and emotion/gender classification using fer2013/IMDB datasets with a keras CNN model and openCV. * IMDB gender classification test accuracy: 96%. * fer2013 emotion classification test accuracy: 66%.

For more information please consult the publication

Emotion/gender examples:

alt tag

Guided back-prop alt tag

Real-time demo:

B-IT-BOTS robotics team :) alt tag

Instructions

Run real-time emotion demo:

python3 videoemotioncolor_demo.py

Run real-time guided back-prop demo:

python3 imagegradcamdemo.py

Make inference on single images:

python3 imageemotiongenderdemo.py <imagepath>

e.g.

python3 imageemotiongenderdemo.py ../images/testimage.jpg

Running with Docker

With a few steps one can get its own face classification and detection running. Follow the commands below:

  • docker pull ekholabs/face-classifier
  • docker run -d -p 8084:8084 --name=face-classifier ekholabs/face-classifier
  • curl -v -F [email protected][path_to_image]  http://localhost:8084/classifyImage > image.png

To train previous/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

  • Run the trainemotionclassification.py file

    python3 trainemotionclassifier.py

To train previous/new models for gender classification:

  • Download the imdb_crop.tar file from here (It's the 7GB button with the tittle Download faces only).

  • Move the downloaded file to the datasets directory inside this repository.

  • Untar the file:

    tar -xfv imdb_crop.tar

  • Run the traingenderclassification.py file

    python3 traingenderclassifier.py

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.