Skip to content

Facial Expression Recognition Using Attentional Convolutional Network, Pytorch implementation

Notifications You must be signed in to change notification settings

omarsayed7/Deep-Emotion

Repository files navigation

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

  • An end-to-end deep learning framework based on attentional convolutional networks.
  • The attention mechanism is incorporated using spatial transformer networks.

Datasets

This implementation uses the following datasets:

Prerequisites

Make sure you have the following libraries installed:

  • PyTorch >= 1.1.0
  • torchvision == 0.5.0
  • OpenCV
  • tqdm
  • Pillow (PIL)

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

```

About

Facial Expression Recognition Using Attentional Convolutional Network, Pytorch implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages