• Stars
    star
    5,505
  • Rank 7,148 (Top 0.2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 video_emotion_color_demo.py

Run real-time guided back-prop demo:

python3 image_gradcam_demo.py

Make inference on single images:

python3 image_emotion_gender_demo.py <image_path>

e.g.

python3 image_emotion_gender_demo.py ../images/test_image.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 image=@[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 train_emotion_classification.py file

python3 train_emotion_classifier.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 train_gender_classification.py file

python3 train_gender_classifier.py

More Repositories

1

paz

Hierarchical perception library in Python for pose estimation, object detection, instance segmentation, keypoint estimation, face recognition, etc.
Python
568
star
2

STN.keras

Implementation of spatial transformer networks (STNs) in keras 2 with tensorflow as backend.
Jupyter Notebook
276
star
3

neural_image_captioning

Neural image captioning (NIC) implementation with Keras 2.
Jupyter Notebook
175
star
4

SSD-keras

SSD: Single Shot MultiBox Detector in keras.
Python
84
star
5

RBF-Network

Minimal implementation of a radial basis function network.
Jupyter Notebook
70
star
6

beauvoir

Domain randomization library in Python for object detection and classification using Blender.
Python
15
star
7

luvina

High-level Natural Language Processing (NLP) for Python.
Python
13
star
8

tfp-workshop

Tensorflow probability workshop
Dockerfile
4
star
9

PyGPToolbox

PyGPToolbox - A python geometry processing toolbox
Python
3
star
10

altamira-data

Altamira's external data such as model weights and image-pose dictionaries.
3
star
11

self-organizing-map

Small numpy implementation of self-organizing maps (SOMs).
Jupyter Notebook
2
star
12

ROS_face_classification

Python
1
star
13

pathnet.keras

Implementation of "PathNet: Evolution Channels Gradient Descent in Super Neural Networks" in keras 2.
Python
1
star
14

cnn_benchmarks

CNN benchmarks for Keras models
Python
1
star
15

object_perception

Object perception tasks: detection, tracking and classification.
Python
1
star
16

neras

keras with numpy
Python
1
star
17

image_affine_transformer

A class to apply affine transformations to a batch of images using bilinear interpolation.
Jupyter Notebook
1
star
18

IDE_vim

Integrated development environment (IDE) in vim.
Vim Script
1
star