omarsayed7 / Deep-Emotion

Facial Expression Recognition Using Attentional Convolutional Network, Pytorch implementation
249 stars 73 forks source link

Deep-Emotion: Facial Expression Recognition Using Attentional Convolutional Network

This repository provides a PyTorch implementation of the research paper, Deep-Emotion.

Note: This implementation is not the official one described in the paper.

Architecture

Datasets

This implementation uses the following datasets:

Prerequisites

Make sure you have the following libraries installed:

Repository Structure

This repository is organized as follows:

Usage

Watch this informative video created by DeepLearning_by_PhDScholar for a comprehensive guide on using this implementation.

Data Preparation

  1. Download the dataset from Kaggle.
  2. Decompress train.csv and test.csv into the ./data folder.

How to Run

Setup the Dataset

python main.py [-s [True]] [-d [data_path]]

--setup                 Setup the dataset for the first time
--data                  Data folder that contains data files

To train the model

python main.py [-t] [--data [data_path]] [--hparams [hyperparams]]
              [--epochs] [--learning_rate] [--batch_size]

--data                  Data folder that contains training and validation files
--train                 True when training
--hparams               True when changing the hyperparameters
--epochs                Number of epochs
--learning_rate         Learning rate value
--batch_size            Training/validation batch size

To validate the model

python visualize.py [-t] [-c] [--data [data_path]] [--model [model_path]]

--data                  Data folder that contains test images and test CSV file
--model                 Path to pretrained model
--test_cc               Calculate the test accuracy
--cam                   Test the model in real-time with webcam connected via USB

Prediction Samples