Method for facial emotion recognition compitition of Xunfei and Datawhale .

Overview

人脸情绪识别挑战赛-第3名-W03KFgNOc-源代码、模型以及说明文档

  1. 队名:W03KFgNOc
  2. 排名:3
  3. 正确率: 0.75564
  4. 队员:yyMoming,xkwang,RichardoMu
  5. 比赛链接:人脸情绪识别挑战赛
  6. 文章地址:link

emotion

该项目分别训练八个模型并生成csv文件,并进行融合

构建conda环境

conda create -n emotion python==3.8.0
conda activate emotion
cd {project_path}
pip install -r requirements.txt

训练

打开train.sh,可以看到训练的命令行,依次注释和解注释随后运行train.sh。 因为是训练八个模型,分别是efficientnet_b2b, efficientnet_b3b, cbam_resnet50, resmasking,resmasking_dropout1,resnest269e,swin,hrnet_w64,所以要训练和测试,需要分别进行8次。

  1. 训练efficientnet_b2b
python main_fer2013.py --config ./config/efficientnet_b2b_config.json
  1. 训练efficientnet_b3b
python main_fer2013.py --config ./config/efficientnet_b3b_config.json
  1. 训练cbam_resnet50
python main_fer2013.py --config ./config/cbam_resnet50_config.json
  1. 训练hrnet_w64
python main_fer2013.py --config ./config/hrnet_w64_config.json
  1. 训练resmasking
python main_fer2013.py --config ./config/resmasking_config.json
  1. 训练resmasking_dropout1
python main_fer2013.py --config ./config/resmasking_dropout1_config.json
  1. 训练resnest269e
python main_fer2013.py --config ./config/resnest269e_config.json
  1. 训练swin
python main_fer2013.py --config ./config/swin_config.json

checkpoint保存在{project_path}/checkpoint目录下,可以在log文件夹下查看训练的日志。

预测

具体内容在test.sh文件中。各个模型我们存放在百度云盘 https://pan.baidu.com/s/1mM-APWoLV5P3nvrzmG--Jg 提取码 1gyh

下载后复制到user_data/model_data下面即可运行下面的命令进行预测。

  1. 预测efficientnet_b2b
python gen_results.py --config ./config/efficientnet_b2b_config.json --model_name efficientnet_b2b --checkpoint_path efficientnet_b2b_2021Jul25_17.08
  1. 预测efficientnet_b3b
python gen_results.py --config ./config/efficientnet_b3b_config.json --model_name efficientnet_b3b --checkpoint_path efficientnet_b3b_2021Jul25_20.08
  1. 测试cbam_resnet50
python gen_results.py --config ./config/cbam_resnet50_config.json --model_name cbam_resnet50 --checkpoint_path cbam_resnet50_test_2021Jul24_19.18
  1. 测试hrnet_w64
python gen_results.py --config ./config/hrnet_w64_config.json --model_name hrnet_w64 --checkpoint_path hrnet_test_2021Aug01_17.13
  1. 测试resmasking
python gen_results.py --config ./config/resmasking_config.json --model_name resmasking --checkpoint_path resmasking_test_2021Jul26_14.33
  1. 测试resmasking_dropout1
python gen_results.py --config ./config/resmasking_dropout1_config.json --model_name resmasking_dropout1 --checkpoint_path resmasking_dropout1_test_2021Aug01_17.13
  1. 测试resnest269e
python gen_results.py --config ./config/resnest269e_config.json --model_name resnest269e --checkpoint_path resnest269e_test_2021Aug02_11.39
  1. 测试swin
python gen_results.py --config ./config/swin_config.json --model_name swin_large_patch4_window7_224 --checkpoint_path swin_large_patch4_window7_224_test_2021Aug02_21.36

请注意,这里的model_name是确定的,checkpoint_path是你训练得到模型的名字,如果你自己训练了其中的一些模型,请将对应的名称修改为训练得到模型的名称。

集成

上述8个模型的预测结果统一放在user_data/tmp_data里面,下面使用集成方法对上述八个模型的结果进行整合。

python gen_ensemble.py

我们将上述八个模型的结果进行集成,最终生成的文件放在prediction_result下面的result.csv文件中。

You might also like...
An Api for Emotion recognition.
An Api for Emotion recognition.

PLAYEMO Playemo was built from the ground-up with Flask, a python tool that makes it easy for developers to build APIs. Use Cases Is Python your langu

This repo contains implementation of different architectures for emotion recognition in conversations.
This repo contains implementation of different architectures for emotion recognition in conversations.

Emotion Recognition in Conversations Updates 🔥 🔥 🔥 Date Announcements 03/08/2021 🎆 🎆 We have released a new dataset M2H2: A Multimodal Multiparty

 Tensorflow Implementation for
Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition"

Tensorflow Implementation for "Pre-trained Deep Convolution Neural Network Model With Attention for Speech Emotion Recognition" Pre-trained Deep Convo

The world's simplest facial recognition api for Python and the command line
The world's simplest facial recognition api for Python and the command line

Face Recognition You can also read a translated version of this file in Chinese 简体中文版 or in Korean 한국어 or in Japanese 日本語. Recognize and manipulate fa

Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition
Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks

Spontaneous Facial Micro Expression Recognition using 3D Spatio-Temporal Convolutional Neural Networks Abstract Facial expression recognition in video

A facial recognition doorbell system using a Raspberry Pi

Facial Recognition Doorbell This project expands on the person-detecting doorbell system to allow it to identify faces, and announce names accordingly

 Relative Uncertainty Learning for Facial Expression Recognition
Relative Uncertainty Learning for Facial Expression Recognition

Relative Uncertainty Learning for Facial Expression Recognition The official implementation of the following paper at NeurIPS2021: Title: Relative Unc

Software for Multimodalty 2D+3D Facial Expression Recognition (FER) UI
Software for Multimodalty 2D+3D Facial Expression Recognition (FER) UI

EmotionUI Software for Multimodalty 2D+3D Facial Expression Recognition (FER) UI. demo screenshot (with RealSense) required packages Python = 3.6 num

Owner
Working in human-computer-interaction, gaze-estimation and class education analysis. CSDN:https://blog.csdn.net/weixin_42264234
null
SEOVER: Sentence-level Emotion Orientation Vector based Conversation Emotion Recognition Model

SEOVER-Master This code is the implementation of paper: SEOVER: Sentence-level Emotion Orientation Vector based Conversation Emotion Recognition Model

null 4 Feb 24, 2022
Testing the Facial Emotion Recognition (FER) algorithm on animations

PegHeads-Tutorial-3 Testing the Facial Emotion Recognition (FER) algorithm on animations

PegHeads Inc 2 Jan 3, 2022
Emotion Recognition from Facial Images

Reconhecimento de Emoções a partir de imagens faciais Este projeto implementa um classificador simples que utiliza técncias de deep learning e transfe

Gabriel 2 Feb 9, 2022
Web service for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation based on OpenFace 2.0

OpenGaze: Web Service for OpenFace Facial Behaviour Analysis Toolkit Overview OpenFace is a fantastic tool intended for computer vision and machine le

Sayom Shakib 4 Nov 3, 2022
OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.

OpenFace 2.2.0: a facial behavior analysis toolkit Over the past few years, there has been an increased interest in automatic facial behavior analysis

Tadas Baltrusaitis 5.8k Dec 31, 2022
Automatically measure the facial Width-To-Height ratio and get facial analysis results provided by Microsoft Azure

fwhr-calc-website This project is to automatically measure the facial Width-To-Height ratio and get facial analysis results provided by Microsoft Azur

SoohyunPark 1 Feb 7, 2022
Code of the lileonardo team for the 2021 Emotion and Theme Recognition in Music task of MediaEval 2021

Emotion and Theme Recognition in Music The repository contains code for the submission of the lileonardo team to the 2021 Emotion and Theme Recognitio

Vincent Bour 8 Aug 2, 2022
Face Recognition and Emotion Detector Device

Face Recognition and Emotion Detector Device Orange PI 1 Python 3.10.0 + Django 3.2.9 Project's file explanation Django manage.py Django commands hand

BootyAss 2 Dec 21, 2021
A real-time speech emotion recognition application using Scikit-learn and gradio

Speech-Emotion-Recognition-App A real-time speech emotion recognition application using Scikit-learn and gradio. Requirements librosa==0.6.3 numpy sou

Son Tran 6 Oct 4, 2022
Speech Emotion Recognition with Fusion of Acoustic- and Linguistic-Feature-Based Decisions

APSIPA-SER-with-A-and-T This code is the implementation of Speech Emotion Recognition (SER) with acoustic and linguistic features. The network model i

kenro515 3 Jan 4, 2023