GithubHelp home page GithubHelp logo

sanjay289 / deep-emotion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omarsayed7/deep-emotion

0.0 0.0 0.0 213 KB

Facial Expression Recognition Using Attentional Convolutional Network, Pytorch implementation

Python 100.00%

deep-emotion's Introduction

Deep-Emotion: Facial Expression Recognition Using Attentional Convolutional Network

This is a PyTorch implementation of research paper, Deep-Emotion

[Note] This is not the official implementation of the paper

Architecture

  • An end-to-end deep learning framework, based on attentional convolutional network
  • Attention mechanism is added through spatial transformer network

Datasets

Prerequisites

To run this code, you need to have the following libraries:

  • pytorch >= 1.1.0
  • torchvision ==0.5.0
  • opencv
  • tqdm
  • PIL

Structure of this repository

This repository is organized as :

  • main This file contains setup of the dataset and training loop.
  • visualize This file contains the source code for evaluating the model on test data and real-time testing on webcam.
  • deep_emotion This file contains the model class
  • data_loaders This file contains the dataset class
  • generate_data This file contains the setup of the dataset

Usage

Cool video created by DeepLearning_by_PhDScholar for how to use this implementation.

Data preparation

Download the dataset from Kaggle, and decompress train.csv and test.csv into ./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 connect via USB

Prediction Samples

deep-emotion's People

Contributors

omarsayed7 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.