The Img2Emo project is designed to train and evaluate models for valence and arousal estimation from images. This guide will help you understand how to use the provided scripts to train and evaluate models using different datasets and configurations.
Ensure you have the necessary environment set up to run the scripts, including any dependencies and datasets required for the project. Requirements:
- Python 3.10
- Pytorch >= 2.0
To train a simple baseline model, you can use the following commands. Uncomment the desired line in the run.sh
script to execute:
bash scripts/img2emo/va_random_sampler.sh 1 EMOTIC
bash scripts/img2emo/va_random_sampler.sh 1 EMOTIC NAPS_H
bash scripts/img2emo/va_random_sampler.sh 1 EMOTIC NAPS_H OASIS
To evaluate the baseline model, use the following commands. Uncomment the desired line in the run.sh
script to execute:
bash scripts/img2emo/eval_va_fusion_dataset.sh 1 EMOTIC
bash scripts/img2emo/eval_va_fusion_dataset.sh 1 EMOTIC NAPS_H
bash scripts/img2emo/eval_va_fusion_dataset.sh 1 EMOTIC NAPS_H OASIS
To scale up the model using LoRA, use the following commands. Uncomment the desired line in the run.sh
script to execute:
bash scripts/img2emo/va_giantvit_lora.sh 1 32 EMOTIC NAPS_H OASIS
bash scripts/img2emo/va_giantvit_lora.sh 1 32 EMOTIC NAPS_H OASIS Emotion6
To perform inference on your custom dataset, please refer to the file inference.py
.
We provide an API in inferencer.py
, you can use it to perform inference on your custom dataset.
This project is inspired by and builds upon various existing works in the field of emotion recognition and model scaling.
For more details, refer to the individual script files and their documentation.
If you have any problems, please contact me.