GithubHelp home page GithubHelp logo

macdroid-dong / body-language-and-emotion-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shrookehab/body-language-and-emotion-recognition

0.0 0.0 0.0 64.11 MB

License: MIT License

CSS 3.61% JavaScript 4.70% Jupyter Notebook 2.11% HTML 0.45% Python 88.28% PowerShell 0.05% Batchfile 0.04% Tcl 0.76%

body-language-and-emotion-recognition's Introduction

Emotic

Humans use their facial features or expressions to convey how they feel, such as a person may smile when happy and scowl when angry. Historically, computer vision research has focussed on analyzing and learning these facial features to recognize emotions. However, these facial features are not universal and vary extensively across cultures and situations.

Fig 1: a) (Facial feature) The person looks angry or in pain b) (Whole scene) The person looks elated.

A scene context, as shown in the figure above, can provide additional information about the situations. This project explores the use of context in recognizing emotions in images.

Pipeline

The project uses the EMOTIC dataset and follows the methodology as introduced in the paper 'Context based emotion recognition using EMOTIC dataset'.

Pipeline

Fig 2: Model Pipeline (Image source)

Two feature extraction modules first extract features over an image. These features are then used by a third module to predict the continuous dimensions (valence, arousal and dominance) and the discrete emotion categories.

Usage

Download the Emotic dataset and annotations and prepare the directory following the below structure:

├── ...
│   ├── emotic
│   |    ├── ade20k
│   |    ├── emodb_small
│   |    ├── framesdb
│   |    ├── mscoco 
│   ├── Annotations
│   |    ├── Annotations.mat
  1. To convert annotations from mat object to csv files and preprocess the data:
> python mat2py.py --data_dir proj/data/emotic19 --generate_npy
  • data_dir: Path of the directory containing the emotic and annotations folder as described in the above data directory structure.
  • generate_npy: Argument to specify to generate npy files (later used for training and testing) along with CSV files. If not passed only CSV files are generated.
  1. To train the model:
> python main.py --mode train --data_path proj/data/emotic_pre --experiment_path proj/debug_exp
  • mode: Mode to run the main file.
  • data_path: Path of the directory which contains the preprocessed data and CSV files generated in the first step.
  • experiment_path: Path of the experiment directory. The directory will save the results, models and logs.
  1. To test the model:
> python main.py --mode test --data_path proj/data/emotic_pre --experiment_path proj/debug_exp
  • mode: Mode to run the main file.
  • data_path: Path of the directory which contains the preprocessed data and CSV files generated in the first step.
  • experiment_path: Path of the experiment directory. Models stored in the the directory are used for testing.
  1. To perform inference:
> python main.py --mode inference --inference_file proj/debug_exp/inference_file.txt --experiment_path proj/debug_exp
  • mode: Mode to run the main file.
  • inference_file: Text file specifying images to perform inference. A row is: 'full_path_of_image x1 y1 x2 y2', where (x1,y1) and (x2,y2) specify the bounding box. Refer sample_inference_list.txt.
  • experiment_path: Path of the experiment directory. Models stored in the the directory are used for inference.

You can also train and test models on Emotic dataset by using the Colab_train_emotic notebook. Open In Colab

The trained models and thresholds to use for inference purposes are availble here.

Results

Result GIF 1 Result IMG1 Project Accuracy Website Template

Acknowledgements

Context Based Emotion Recognition using Emotic Dataset

Ronak Kosti, Jose Alvarez, Adria Recasens, Agata Lapedriza
[Paper] [Project Webpage] [Authors' Implementation]

Emotic MASTER MATERIALS FOR GRADUATION PROJECT

[Graduation Project pdf] [Project Survey] [Website Template]

@article{kosti2020context,
  title={Context based emotion recognition using emotic dataset},
  author={Kosti, Ronak and Alvarez, Jose M and Recasens, Adria and Lapedriza, Agata},
  journal={arXiv preprint arXiv:2003.13401},
  year={2020}
}

Author

body-language-and-emotion-recognition's People

Contributors

shrookehab avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.