Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183---license: mittags: - facial-reaction-generation - dyadic-interaction - diffusion-model - affective-computing - react2026 - mafrglanguage: - enpipeline_tag: other---
# CaReDiff β Causal Reaction Diffusion (REACT 2026)
Model checkpoints for **CaReDiff**, a submission to the [REACT 2026 Challenge](https://sites.google.com/view/react2026/home) (ACM MM 2026, Multiple Appropriate Facial Reaction Generation).
Given speaker behaviour (audio, video, 3DMM coefficients, facial attributes), CaReDiff generates multiple appropriate listener facial reactions (25-d: 15 AUs + valence/arousal + 8 expressions) with an auxiliary EEG prediction head.
- **Code:** https://github.com/smu-ivpl/CaReDiff- **Checkpoints (this repo):** https://huggingface.co/IVPL/CaReDiff
## Tracks
| Track | Architecture | Description ||-------|-------------|-------------|| Generic Online | PerFRDiff + EEG | Diffusion-based generation over autoregressive windows || Generic Offline | PerFRDiff + EEG | Diffusion-based full-sequence generation || Personalised Online | PerFRDiff + PRA + EEG | Frozen generic backbone + Personalised Residual Adapter (autoregressive windows) || Personalised Offline | PerFRDiff + PRA + EEG | Frozen generic backbone + Personalised Residual Adapter (full-sequence) |
## Repository Layout
```CaReDiff/βββ generic/β βββ online/ prior + denoiser + EEG head (checkpoint_120.pth)β βββ offline/ prior + denoiser + EEG head (checkpoint_120.pth)βββ personalised/ βββ online/ shared backbone + 3 adapters (personality / lhfb / both) βββ offline/ shared backbone + 3 adapters (personality / lhfb / both)```
Each generic track folder contains:
```<track>/βββ DiffusionPriorNetwork/checkpoint_120.pthβββ CausalTransformerDenoiser/checkpoint_120.pthβββ EEGPredictionHead/checkpoint_120.pth```
## Usage
1. Clone the code repository: ```bash git clone https://github.com/smu-ivpl/CaReDiff ```2. Set up the environment (see the [code README](https://github.com/smu-ivpl/CaReDiff)): ```bash conda create -n react python=3.10 && conda activate react conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia conda install -c fvcore -c iopath -c conda-forge fvcore iopath pip install -r generic/code/requirements.txt ```3. Download the checkpoints from this repo and place them under `save/`. For the generic tracks: ``` save/motion_diffusion/react_2025/ βββ online/checkpoints/pretrained/ β βββ DiffusionPriorNetwork/checkpoint_120.pth β βββ CausalTransformerDenoiser/checkpoint_120.pth β βββ EEGPredictionHead/checkpoint_120.pth βββ offline/checkpoints/pretrained/ βββ ... (same structure) ```4. Run evaluation (see below).
Full placement instructions, SHA-256 checksums, and per-track details are in each variant's `checkpoints/README.md` in the code repository.
### Generic Evaluation
```bash# Generic Onlinepython main.py --config-name generic_online/motion_diffusion \ stage=test data_dir=./datasets/REACT2026/ \ trainer.batch_size=1 resume_id=pretrained
# Generic Offlinepython main.py --config-name generic_offline/motion_diffusion \ stage=test data_dir=./datasets/REACT2026/ \ trainer.batch_size=1 resume_id=pretrained```
### Personalised Evaluation
Each personalised track uses a frozen generic backbone plus one of threecondition adapters (`personality` / `lhfb` / `both`). Download the`personalised/<track>/` folder and set `PKG` to its parent absolute path; thecommands reference every weight explicitly through `PKG`.
```bashPKG=<absolute path of the downloaded personalised folder>
# Personalised Offline (personality condition)python main.py --config-name g2p_delta stage=test task=offline \ data_dir=<MARS_ROOT> run_id=eval_offline_personality \ trainer.batch_size=4 num_gts=10 \ trainer.generic.eval_condition_mode=matched \ trainer.generic.eval_eeg=false \ trainer.main_model.args.personal_condition_mode=personality_only \ resume_id=personality \ trainer.ckpt_dir=$PKG/offline/adapters \ trainer.pretrained.diffusion_decoder=$PKG/offline/backbone/CausalTransformerDenoiser/checkpoint_120.pth \ trainer.pretrained.diffusion_prior=$PKG/offline/backbone/DiffusionPriorNetwork/checkpoint_120.pth \ trainer.pretrained.eeg_head_checkpoint=$PKG/offline/backbone/EEGPredictionHead/checkpoint_120.pth
# Personalised Online (personality condition)python main.py --config-name g2p_delta_online stage=test task=online \ data_dir=<MARS_ROOT> run_id=eval_online_personality \ trainer.batch_size=4 num_gts=10 \ trainer.generic.eval_condition_mode=matched \ trainer.generic.eval_eeg=false \ trainer.main_model.args.personal_condition_mode=personality_only \ trainer.model.diff_model.diffusion_decoder.args.past_l_emotion_drop_prob=0.2 \ resume_id=personality \ trainer.ckpt_dir=$PKG/online/adapters \ trainer.pretrained.diffusion_decoder=$PKG/online/backbone/CausalTransformerDenoiser/checkpoint_120.pth \ trainer.pretrained.diffusion_prior=$PKG/online/backbone/DiffusionPriorNetwork/checkpoint_120.pth \ trainer.pretrained.eeg_head_checkpoint=$PKG/online/backbone/EEGPredictionHead/checkpoint_120.pth```
For the `lhfb` / `both` conditions, change `resume_id` (`lhfb` or `both`) and`personal_condition_mode` (`3dmm_only` or `3dmm_personality`) accordingly. Forthe online track, keep `past_l_emotion_drop_prob=0.2` β it enables thepast-listener conditioning pathway and is required to reproduce the reportednumbers.
## Additional Requirements
- **Post-processor (EmotionVAE) checkpoint** β required for evaluation on every `stage=test` run. Obtain from the [official REACT 2026 baseline](https://github.com/reactmultimodalchallenge/baseline_react2026) and place at `pretrained_models/post_processor/checkpoint.pth`.- **PIRender + FaceVerse** β needed only for FRREa (rendered-frame FID) evaluation.- **MARS dataset** β obtain through the challenge organisers.
## Metrics
| Metric | Description ||--------|-------------|| FRC β | Facial Reaction Consistency || FRD β | Facial Reaction Distance (FID-based) || TLCC β | Time-Lagged Cross-Correlation || S_MSE β | Smoothness (MSE of consecutive frames) || FRVar β | Facial Reaction Variance || FRREa β | Facial Reaction Realism (FID on rendered frames) |
## Citation
```bibtex@article{song2023multiple, title={Multiple Appropriate Facial Reaction Generation in Dyadic Interaction Settings: What, Why and How?}, author={Song, Siyang and Spitale, Micol and Luo, Yiming and Bal, Batuhan and Gunes, Hatice}, journal={arXiv preprint arXiv:2302.06514}, year={2023}}
@inproceedings{song2025react, title={React 2025: the third multiple appropriate facial reaction generation challenge}, author={Song, Siyang and Spitale, Micol and Kong, Xiangyu and Zhu, Hengde and Luo, Cheng and Palmero, Cristina and Barquero, German and others}, booktitle={Proceedings of the 33rd ACM International Conference on Multimedia}, pages={13979--13984}, year={2025}}```
## Acknowledgement
- [FaceVerse](https://github.com/LizhenWangT/FaceVerse)- [PIRender](https://github.com/RenYurui/PIRender)- [REACT 2026 Baseline](https://github.com/reactmultimodalchallenge/baseline_react2026)
## License
MITREADME.mdAdded+183