Giter Club home page Giter Club logo

contrastive-adversarial-learning-fer's Introduction

Contrastive-Adversarial-Learning-for-Person-independent-FER (CAL-FER)

This repository provides the official PyTorch implementation of the following paper:

Contrastive Adversarial Learning for Person Independent Facial Emotion Recognition (AAAI 2021)

  • Real-time demo with pre-trained weights

Requirements

To install all dependencies, do this.

pip install -r requirements.txt

News

[21.06.04]: Add weights of encoder and FC layer.

[21.02.06]: UPLOAD full training and evaluation files.

[21.01.02] OPEN official pytorch version of CAL-FER.


Datasets

  1. Download three public benchmarks for training and evaluation (I cannot upload datasets due to the copyright issue).

(For more details visit website)

  1. Follow preprocessing rules for each dataset by referring pytorch official custom dataset tutorial.

Training and evaluation

1.Go to /src.

2.Train CAF-FER.

python main.py --gpus 0 --train 1 --freq 5 --csv_path <csv_path> --data_path <data_path> --save_path <save_path> --load_path <load_path>

3.Evaluate CAF-FER.

python main.py --gpus 0 --train 0 --csv_path <csv_path> --data_path <data_path> --load_path <load_path>
  • Arguments
  • gpus: GPU number (in case of single GPU, set to 0)
  • train: 1 (training phase), 0 (evaluation phase)
  • freq: Parameter saving frequency
  • csv_path: Path to load name and label script.
  • data_path: Path to load facial dataset.
  • save_path: Path to save weights.
  • load_path: Path to load pre-trained weights.

Real-time demo

  1. Go to /Real_demo.

  2. Run main.py.

  • Facial detection and AV domain FER functions are equipped.
  • Before that, you have to train and save Encoder.t7 and FC_layer.t7.

BibTeX

Please cite our paper if you find our work useful for your research:

@inproceedings{kim2021contrastive,
title={Contrastive Adversarial Learning for Person Independent Facial Emotion Recognition},
author={Kim, Dae Ha and Song, Byung Cheol},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={35},
number={7},
pages={5948--5956},
year={2021}
}

contrastive-adversarial-learning-fer's People

Contributors

kdhht2334 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

contrastive-adversarial-learning-fer's Issues

No module named "aknn_alg"

Hi, thanks for your work. While I run main.py, line 44 "from aknn_alg import aknn, calc_nbrs_exact" occurs an error, may I ask how can I get aknn_alg lib? Thanks in advance.

About pretrainedmodels.py and weighs

Hi, I want to know whether the weights you uploaded is resnet18 or alexnet.
And I found that pretrainedmodels.py is not in your project,so it seems that I can't load the weights..

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.