Code Monkey home page Code Monkey logo

emotion-fan's Introduction

Emotion-FAN.pytorch

ICIP 2019: Frame Attention Networks for Facial Expression Recognition in Videos pdf

Debin Meng, Xiaojiang Peng, Yu Qiao, etc.

If you are using pieces of the posted code, please cite the above paper.

Visualization

We visualize the weights of attention module in the picture. The blue bars represent the self-attention weights and orange bars the final weights (the weights combine self-attention and relation-attention ).

Both weights can reflect the importance of frames. Comparing the blue and orange bars, the final weights of our FAN can assign higher weights to the more obvious face frames, while self-attention module could assign high weights on some obscure face frames. This explains why adding relation-attention boost performance.

Citation

Whether or not it is useful to you, could you please do not hesitate to citing the paper. thanks, thanks, thanks.:

@inproceedings{meng2019frame,
  title={frame attention networks for facial expression recognition in videos},
  author={Meng, Debin and Peng, Xiaojiang and Wang, Kai and Qiao, Yu},
  booktitle={2019 IEEE International Conference on Image Processing (ICIP)},
  pages={3866--3870},
  year={2019},
  organization={IEEE},
  url={https://github.com/Open-Debin/Emotion-FAN}
}

Requirement

Pillow == 6.2.0

numpy == 1.17.2

torch == 1.3.0

torchvision == 0.4.1

Download pretrain models

We share two model of ResNet18, include a model pretrained in MS-Celeb-1M and another in FER+.Baidu or OneDrive

Demo AFEW

Training with self-attention

CUDA_VISIBLE_DEVICES=2 python Demo_AFEW_Attention.py --at_type 0

Training with self-attention and relation-attention

CUDA_VISIBLE_DEVICES=2 python Demo_AFEW_Attention.py --at_type 1

Options

  • --lr: initial learning rate
  • --at_type: 0 is self-attention; 1 is relation-attention
  • --epochs: number of total epochs to run
  • --momentum: momentum
  • --weight-decay: weight decay (default: 1e-4)
  • -e: evaluate model on validation set
  • etc.

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.