Skip to content
Faces is project for tracking faces and multiple models detection from faces such as: Gender, Expressions, Illumination, Pose, Occlusion, Age, Makeup
Jupyter Notebook Python
Branch: master
Clone or download
Latest commit 35a0705 Nov 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images Add files via upload Jul 2, 2019
inputs Add files via upload Jul 2, 2019
models Add files via upload Jul 2, 2019
outputs Add files via upload Nov 8, 2019
Faces.ipynb Add files via upload Jul 2, 2019
README.md Update README.md Nov 8, 2019
__init__.py Add files via upload Jul 2, 2019
blocks.py Add files via upload Nov 8, 2019
centroidtracker.py Add files via upload Nov 8, 2019
models.py Add files via upload Jul 2, 2019
run.py Add files via upload Nov 8, 2019
util.py Add files via upload Nov 8, 2019

README.md

Faces

Faces is project for tracking faces and multiple models detection from faces such as:

  1. Gender : Male, Female
  2. Expressions : Anger, Happiness, Sadness, Surprise, Fear, Disgust
  3. Illumination : Bad, Medium, High
  4. Pose : Frontal, Left, Right, Up, Down
  5. Occlusion : Glasses, Beard, Ornaments, Hair, Hand, None, Others
  6. Age : Child, Young, Middle and Old
  7. Makeup : Partial makeup, Over-makeup

Ryan Reynolds & Jake Gyllenhaal Answer the Web's Most Searched Questions _ WIRED

and here some examples of prediction on images

Faces

Faces

Faces

Faces

Faces

Requirements

Run

to use Faces execute run.py file with various options

usage: run.py [-h] [--cuda CUDA] [--show SHOW] [--delay DELAY]
                  [--inputs_path INPUTS_PATH] [--outputs_path OUTPUTS_PATH]
                  [--models_path MODELS_PATH] [--models MODELS [MODELS ...]]

optional arguments:
  -h, --help            show this help message and exit
  --cuda                set this parameter to True value if you want to use
                        cuda gpu, default is False
  --show                set this parameter to True value if you want display
                        images/videos while processing, default is False
  --tracking            set this parameter to True value if you want tracking
                        faces in images/videos, default is False
  --delay DELAY         amount of seconds to wait to switch between images
                        while show the precess
  --inputs_path INPUTS_PATH
                        path for directory contains images/videos to process,
                        if you don't use it webcam will open to start the
                        record
  --outputs_path OUTPUTS_PATH
                        path for directory to add the precesses images/videos
                        on it, if you don't use it output directory will
                        created and add the precesses images/videos on it
  --models_path MODELS_PATH
                        path for directory contains pytorch model
  --models MODELS [MODELS ...]
                        first index refers to gender model, second index
                        refers to expression model, and third index refers to
                        multiple models

Datasets

Models

models in this project are based on Real-time Convolutional Neural Networks for Emotion and Gender Classification paper model architecture:

mini exception cnn model

project consist of 3 models:

  1. Gender
  2. Expression
  3. Multiple

Gender Model

trained done by using IMDB , WIKI, IMFDB datasets. consist of ~ 600 K image, and by using tencrop data augmentation dataset increased to be ~ 6 M image Accuracy ~ 78% using only 6 epochs and it will reach higher accuracy expected to be ~ 96 %

Expression Model

trained done by using FER , IMFDB, JAFFE image datasets. consist of ~ 40 K image, and by using tencrop data augmentation dataset increased to be ~ 400 K image Accuracy ~ 60% using 15 epochs and it will reach higher accuracy expected to be ~ 66 %

Multiple Models

this model is little bit different form Gender & Expression models in this model we use one feature extractor model and 5 different classifiers each classifier predict specific features form faces and they are:

  • Illumination : Bad, Medium, High
  • Pose : Frontal, Left, Right, Up, Down
  • Occlusion : Glasses, Beard, Ornaments, Hair, Hand, None, Others
  • Age : Child, Young, Middle and Old
  • Makeup : Partial makeup, Over-makeup

trained done by using IMFDB image datasets consist of ~ 3 K image, and by using tencrop data augmentation dataset increased to be ~ 30 K image Accuracy ~ 77% using 15 epochs

Train

all training process done on Faces notebook using Google Colab cloud

Credits

Real-time Convolutional Neural Networks for Emotion and Gender Classification paper

Simple object tracking with OpenCV by pyimagesearch

You can’t perform that action at this time.