Code Monkey home page Code Monkey logo

dan's Introduction

Distract Your Attention: Multi-head Cross Attention Network for Facial Expression Recognition

overview

A PyTorch implementation of the DAN, pre-trained models are available for deployment.

Preparation

  • Download pre-trained model of MSCeleb and move the file to ./models
  • Download RAF-DB dataset and extract the raf-basic dir to ./datasets
  • Download AffectNet dataset and extract the AffectNet dir to ./datasets
  • Run python ./utils/convert_affectnet.py to store a split version of AffectNet dataset.

Training

We provide the training code for AffectNet and RAF-DB.

For AffectNet-8 dataset, run:

CUDA_VISIBLE_DEVICES=0 python affectnet.py --epochs 10 --num_class 8

For AffectNet-7 dataset, run:

CUDA_VISIBLE_DEVICES=0 python affectnet.py --epochs 10 --num_class 7

For RAF-DB dataset, run:

CUDA_VISIBLE_DEVICES=0 python rafdb.py

Models

Pre-trained models can be downloaded for evaluation as following:

task epochs accuracy link
AffectNet-8 5 62.09 download
AffectNet-7 6 65.69 download
RAF-DB 21 89.70 download

Deployment

There is a simple demo to invoke DAN model for a emotion inference:

CUDA_VISIBLE_DEVICES=0 python demo.py --image test_image_path

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.