Skip to content

A simple python program that can predict different facial expressions given a neutral model.

License

Notifications You must be signed in to change notification settings

SestoAle/Facial-Expression-Prediction

Repository files navigation

Facial Expression Prediction

This project aims to predict different facial expressions given a neutral model, to populate a Neural Network dataset.

For this purpose we made some statistics analysis of a set of facial expressions. After these studies, we achieved to build an efficient facial expression predictor that can translate a neutral model to an expressive face.

The expressions studied are:

  • angry;
  • contempt;
  • disgust;
  • fear;
  • happy;
  • sadness;
  • surprise.

The project is developed by Alessandro Sestini and Francesco Lombardi

Implementation

In order to strengthen the results, different techniques have been used:

  • Mean, median, mode
  • Linear regression
  • Support Vector Regression (SVR)
  • Neural Network

After a study of data distributions through Mean Shift algorithm, we can conclude that the best method to create a good quality facial expression is the statistics method.

A result example is shown in the figure below; the script let the user to emphasize the expression changing an alpha value.:

Installation

To run the project follow these instructions:

  1. download the repository;

  2. open main.py and change the values in order to obtain the expressions you prefer. You can follow the instructions on the comments;

  3. the script will output both the neutral and expressive faces.

Requirements

Software Version Required
Python >= 3.5 Yes
MATLAB >= R2017b Yes
MATLAB engine * Yes
Numpy (Python Package) Tested on v1.13.3 Yes
Scikit-learn (Python Package) Tested on v0.19.1 Yes
h5py (Python Package) Tested on v0.19.1 Yes

*the installation procedure for Matlab engine for Python is available here

Report

A copy of the report (italian) can be found here.

License

Licensed under the term of MIT License.

About

A simple python program that can predict different facial expressions given a neutral model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published