hopeof JihoonChoi commited on
Commit
63e80cd
·
0 Parent(s):

Duplicate from IVPL/CaReDiff

Browse files

Co-authored-by: Jihoon Choi <JihoonChoi@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IVPL
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - facial-reaction-generation
5
+ - dyadic-interaction
6
+ - diffusion-model
7
+ - affective-computing
8
+ - react2026
9
+ - mafrg
10
+ language:
11
+ - en
12
+ pipeline_tag: other
13
+ ---
14
+
15
+ # CaReDiff — Causal Reaction Diffusion (REACT 2026)
16
+
17
+
18
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/65fdba70f485b5180897c642/q5J2ScpexbMFlRiEllA4p.png" alt="react_challenge_figure" width="600">
19
+
20
+ 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).
21
+
22
+ 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.
23
+
24
+ - **Code:** https://github.com/smu-ivpl/CaReDiff
25
+ - **Checkpoints (this repo):** https://huggingface.co/IVPL/CaReDiff
26
+
27
+ ## Tracks
28
+
29
+ | Track | Architecture | Description |
30
+ |-------|-------------|-------------|
31
+ | Generic Online | PerFRDiff + EEG | Diffusion-based generation over autoregressive windows |
32
+ | Generic Offline | PerFRDiff + EEG | Diffusion-based full-sequence generation |
33
+ | Personalised Online | PerFRDiff + PRA + EEG | Frozen generic backbone + Personalised Residual Adapter (autoregressive windows) |
34
+ | Personalised Offline | PerFRDiff + PRA + EEG | Frozen generic backbone + Personalised Residual Adapter (full-sequence) |
35
+
36
+ ## Repository Layout
37
+
38
+ ```
39
+ CaReDiff/
40
+ ├── generic/
41
+ │ ├── online/ prior + denoiser + EEG head (checkpoint_120.pth)
42
+ │ └── offline/ prior + denoiser + EEG head (checkpoint_120.pth)
43
+ └── personalised/
44
+ ├── online/ shared backbone + 3 adapters (personality / lhfb / both)
45
+ └── offline/ shared backbone + 3 adapters (personality / lhfb / both)
46
+ ```
47
+
48
+ Each generic track folder contains:
49
+
50
+ ```
51
+ <track>/
52
+ ├── DiffusionPriorNetwork/checkpoint_120.pth
53
+ ├── CausalTransformerDenoiser/checkpoint_120.pth
54
+ └── EEGPredictionHead/checkpoint_120.pth
55
+ ```
56
+
57
+ ## Usage
58
+
59
+ 1. Clone the code repository:
60
+ ```bash
61
+ git clone https://github.com/smu-ivpl/CaReDiff
62
+ ```
63
+ 2. Set up the environment (see the [code README](https://github.com/smu-ivpl/CaReDiff)):
64
+ ```bash
65
+ conda create -n react python=3.10 && conda activate react
66
+ conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
67
+ conda install -c fvcore -c iopath -c conda-forge fvcore iopath
68
+ pip install -r generic/code/requirements.txt
69
+ ```
70
+ 3. Download the checkpoints from this repo and place them under `save/`. For the generic tracks:
71
+ ```
72
+ save/motion_diffusion/react_2025/
73
+ ├── online/checkpoints/pretrained/
74
+ │ ├── DiffusionPriorNetwork/checkpoint_120.pth
75
+ │ ├── CausalTransformerDenoiser/checkpoint_120.pth
76
+ │ └── EEGPredictionHead/checkpoint_120.pth
77
+ └── offline/checkpoints/pretrained/
78
+ └── ... (same structure)
79
+ ```
80
+ 4. Run evaluation (see below).
81
+
82
+ Full placement instructions, SHA-256 checksums, and per-track details are in each variant's `checkpoints/README.md` in the code repository.
83
+
84
+ ### Generic Evaluation
85
+
86
+ ```bash
87
+ # Generic Online
88
+ python main.py --config-name generic_online/motion_diffusion \
89
+ stage=test data_dir=./datasets/REACT2026/ \
90
+ trainer.batch_size=1 resume_id=pretrained
91
+
92
+ # Generic Offline
93
+ python main.py --config-name generic_offline/motion_diffusion \
94
+ stage=test data_dir=./datasets/REACT2026/ \
95
+ trainer.batch_size=1 resume_id=pretrained
96
+ ```
97
+
98
+ ### Personalised Evaluation
99
+
100
+ Each personalised track uses a frozen generic backbone plus one of three
101
+ condition adapters (`personality` / `lhfb` / `both`). Download the
102
+ `personalised/<track>/` folder and set `PKG` to its parent absolute path; the
103
+ commands reference every weight explicitly through `PKG`.
104
+
105
+ ```bash
106
+ PKG=<absolute path of the downloaded personalised folder>
107
+
108
+ # Personalised Offline (personality condition)
109
+ python main.py --config-name g2p_delta stage=test task=offline \
110
+ data_dir=<MARS_ROOT> run_id=eval_offline_personality \
111
+ trainer.batch_size=4 num_gts=10 \
112
+ trainer.generic.eval_condition_mode=matched \
113
+ trainer.generic.eval_eeg=false \
114
+ trainer.main_model.args.personal_condition_mode=personality_only \
115
+ resume_id=personality \
116
+ trainer.ckpt_dir=$PKG/offline/adapters \
117
+ trainer.pretrained.diffusion_decoder=$PKG/offline/backbone/CausalTransformerDenoiser/checkpoint_120.pth \
118
+ trainer.pretrained.diffusion_prior=$PKG/offline/backbone/DiffusionPriorNetwork/checkpoint_120.pth \
119
+ trainer.pretrained.eeg_head_checkpoint=$PKG/offline/backbone/EEGPredictionHead/checkpoint_120.pth
120
+
121
+ # Personalised Online (personality condition)
122
+ python main.py --config-name g2p_delta_online stage=test task=online \
123
+ data_dir=<MARS_ROOT> run_id=eval_online_personality \
124
+ trainer.batch_size=4 num_gts=10 \
125
+ trainer.generic.eval_condition_mode=matched \
126
+ trainer.generic.eval_eeg=false \
127
+ trainer.main_model.args.personal_condition_mode=personality_only \
128
+ trainer.model.diff_model.diffusion_decoder.args.past_l_emotion_drop_prob=0.2 \
129
+ resume_id=personality \
130
+ trainer.ckpt_dir=$PKG/online/adapters \
131
+ trainer.pretrained.diffusion_decoder=$PKG/online/backbone/CausalTransformerDenoiser/checkpoint_120.pth \
132
+ trainer.pretrained.diffusion_prior=$PKG/online/backbone/DiffusionPriorNetwork/checkpoint_120.pth \
133
+ trainer.pretrained.eeg_head_checkpoint=$PKG/online/backbone/EEGPredictionHead/checkpoint_120.pth
134
+ ```
135
+
136
+ For the `lhfb` / `both` conditions, change `resume_id` (`lhfb` or `both`) and
137
+ `personal_condition_mode` (`3dmm_only` or `3dmm_personality`) accordingly. For
138
+ the online track, keep `past_l_emotion_drop_prob=0.2` — it enables the
139
+ past-listener conditioning pathway and is required to reproduce the reported
140
+ numbers.
141
+
142
+ ## Additional Requirements
143
+
144
+ - **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`.
145
+ - **PIRender + FaceVerse** — needed only for FRRea (rendered-frame FID) evaluation.
146
+ - **MARS dataset** — obtain through the challenge organisers.
147
+
148
+ ## Metrics
149
+
150
+ | Metric | Description |
151
+ |--------|-------------|
152
+ | FRCorr ↑ | Facial Reaction Correlation (CCC against GT) |
153
+ | FRDist ↓ | Facial Reaction Distance (DTW against GT) |
154
+ | FRDiv ↑ | Diversity across the 10 generated predictions (pairwise MSE) |
155
+ | FRVar ↑ | Temporal variance within a generated reaction |
156
+ | FRRea ↓ | Realism (FID on rendered frames) |
157
+ | FRSyn ↓ | Synchrony (Time-Lagged Cross-Correlation) |
158
+
159
+ ## Citation
160
+
161
+ ```bibtex
162
+ @article{song2023multiple,
163
+ title={Multiple Appropriate Facial Reaction Generation in Dyadic Interaction Settings: What, Why and How?},
164
+ author={Song, Siyang and Spitale, Micol and Luo, Yiming and Bal, Batuhan and Gunes, Hatice},
165
+ journal={arXiv preprint arXiv:2302.06514},
166
+ year={2023}
167
+ }
168
+
169
+ @inproceedings{song2025react,
170
+ title={React 2025: the third multiple appropriate facial reaction generation challenge},
171
+ author={Song, Siyang and Spitale, Micol and Kong, Xiangyu and Zhu, Hengde and Luo, Cheng and Palmero, Cristina and Barquero, German and others},
172
+ booktitle={Proceedings of the 33rd ACM International Conference on Multimedia},
173
+ pages={13979--13984},
174
+ year={2025}
175
+ }
176
+ ```
177
+
178
+ ## Acknowledgement
179
+
180
+ - [FaceVerse](https://github.com/LizhenWangT/FaceVerse)
181
+ - [PIRender](https://github.com/RenYurui/PIRender)
182
+ - [REACT 2026 Baseline](https://github.com/reactmultimodalchallenge/baseline_react2026)
183
+
184
+ ## License
185
+
186
+ MIT
generic/offline/CausalTransformerDenoiser/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68faca9700415c949eecbe7bd3e381877a76b5e1b24bdab9c30e6fd5b628faa2
3
+ size 561047170
generic/offline/DiffusionPriorNetwork/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1b66e87f51afd9bb93bdcef1b9e350e6366aa8f995920e400d7e7dd4e299357
3
+ size 481319450
generic/offline/EEGPredictionHead/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:750c49999a180cda330b88d771f99d1dca0fd94a810470ea77a45561cfd58780
3
+ size 418238964
generic/online/CausalTransformerDenoiser/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4fc53506fc94a65e86b52bfe1491669a73ca3429ad0b1ab51c62488854242f0
3
+ size 561047170
generic/online/DiffusionPriorNetwork/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b717d619cd37fc793f80f37a4af607bda5e9709c83b82f17916b2467a4380a6
3
+ size 481319450
generic/online/EEGPredictionHead/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60c7a7ae4e6a233fdb59c0ee1e099daf1158931d876a5f46386a781fa2a52a52
3
+ size 418238964
personalised/offline/adapters/both/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73434669c633bc6384acc9845e62c0c4302c9322be27f04e30005e55dda3ab92
3
+ size 12226442
personalised/offline/adapters/lhfb/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ddfde5284c580c3cc461006b2b7cd4df73d2715a8700d3838d8d5e5db8eb7f4
3
+ size 9420474
personalised/offline/adapters/personality/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e0a501237c9b80b8c9e9524bd089fa5ca54ad747bdf9ed65dd97b8d883bf928
3
+ size 6804442
personalised/offline/backbone/CausalTransformerDenoiser/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68faca9700415c949eecbe7bd3e381877a76b5e1b24bdab9c30e6fd5b628faa2
3
+ size 561047170
personalised/offline/backbone/DiffusionPriorNetwork/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1b66e87f51afd9bb93bdcef1b9e350e6366aa8f995920e400d7e7dd4e299357
3
+ size 481319450
personalised/offline/backbone/EEGPredictionHead/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:750c49999a180cda330b88d771f99d1dca0fd94a810470ea77a45561cfd58780
3
+ size 418238964
personalised/online/adapters/both/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77a744f486c46484dc7a357c484bd5c3582345ea5f6947aea1aa625ba00e660a
3
+ size 12226442
personalised/online/adapters/lhfb/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5d8c774774b8a1994be3149c3bb475384326e24a9af64edbf15cda0292da868
3
+ size 9420474
personalised/online/adapters/personality/ModifierNetwork/checkpoint_best.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fad7691aea8c1895a11fcc7d40873d83ea44e0692e6dfb75f736d89cdd9e62d0
3
+ size 6804442
personalised/online/backbone/CausalTransformerDenoiser/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4fc53506fc94a65e86b52bfe1491669a73ca3429ad0b1ab51c62488854242f0
3
+ size 561047170
personalised/online/backbone/DiffusionPriorNetwork/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b717d619cd37fc793f80f37a4af607bda5e9709c83b82f17916b2467a4380a6
3
+ size 481319450
personalised/online/backbone/EEGPredictionHead/checkpoint_120.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60c7a7ae4e6a233fdb59c0ee1e099daf1158931d876a5f46386a781fa2a52a52
3
+ size 418238964