Skip to content

Final degree project about predicting emotions from facial expressions

License

Notifications You must be signed in to change notification settings

carluqcor/EmotionFaceRecognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EmotionFaceRecognition

Description

EmotionFaceRecognition is a software designed to predict emotions from facial expressions written in Python. The purpose of this project is to allow a machine to be capable to detect face expressions while predicting the emotions.

Table of Contents

Install

# Repository files
$ git clone git@github.com:i62lucoc/EmotionFaceRecognition.git

# Download large files from Google Drive
$ cd EmotionFaceRecognition/
$ python3 download.py

# Install pipenv (Recommended)  or install libraries manually
$ pip3 install pipenv
$ pipenv install

# Activate shell for executables
$ pipenv shell

Demo parameters

Parameter Description Command Required Default Options
Results Directory Directory path to save results -r True None None
Confidence Confidence to accept a face detection from DNN OpenCV detector -c False 0.75 None
Model File Trained model filename -m False vgg19.h5 None
Window Size Integer number to apply temporal window operations -w False 3 < 2 (Deactivate)
> 1 (Activate)
Operation Operation to apply when temporal window is activated -o False AVG AVG
MEDIAN
MAX
Face Detector Select which face detector is going to be used -d False DNN DNN
OPENCV
DLIB
Media Input Select input media -i False 0 0 (Camera)
Video file
Image file
Folder with images

Demo

# Access to demo executable
$ cd Executables/

# Execute demo with default values (camera, AVG, DNN OpenCV detector and windowSize = 3)
$ python3 demo.py -r folder/

# Watch out! If you are going to execute demo more than once give other folder pathname or delete the existing one
$ python3 demo.py -r folderDNN/ -i ../Images/ -m ../Models/vgg19.h5 -d DNN

Output in folderDNN

alt text

Visualization emotion predict

alt text

# Execute demo with a video and using OpenCV HaarCascade detector
$ python3 demo.py -r folderDNN/ -i ../Videos/se01.mp4 -m ../Models/vgg19.h5 -d DNN
$ python3 demo.py -r folderOPENCV/ -i ../Videos/se01.mp4 -m ../Models/vgg19.h5 -d OPENCV
$ python3 demo.py -r folderDLIB/ -i ../Videos/se01.mp4 -m ../Models/vgg19.h5 -d DLIB

Visualization of emotions predicted on video with different facial detectors

DNN OpenCV

Emotions

HaarCascade OpenCV

Emotions

DLIB

Emotions

Uninstall

# Give permissions to execute uninstall script
$ chmod 777 uninstall.sh

$ ./uninstall.sh

Built with

  • TensorFlow - Tools for machine learning.
  • Keras - Tools for convolutional neural networks.
  • OpenCV - Tools for image processing
  • EmotioNet - Database for training and validation.
  • EmotionFACS - Database for training and validation.
  • AffectNet - Database for training and validation.

Credits

Authors

  • Carlos Luque Córdoba - lead developer: GitHub & LinkedIn.
  • Manuel J. Marín-Jiménez - advisor: GitHub

License

This project is licensed under the GNU GPL v3 License - see the LICENSE.md file for details.

About

Final degree project about predicting emotions from facial expressions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published