Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- multimodal
|
| 5 |
+
- emotion-recognition
|
| 6 |
+
- ambivalence
|
| 7 |
+
- hesitancy
|
| 8 |
+
- ABAW10
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# ConflictAwareAH — Ambivalence/Hesitancy Recognition
|
| 12 |
+
|
| 13 |
+
Pre-trained weights for the Conflict-Aware Multimodal Fusion model (ABAW10 Challenge, AVGF1 0.715).
|
| 14 |
+
|
| 15 |
+
## Usage
|
| 16 |
+
|
| 17 |
+
```python
|
| 18 |
+
import torch
|
| 19 |
+
from bah.models import ConflictAwareAHModel
|
| 20 |
+
from huggingface_hub import hf_hub_download
|
| 21 |
+
|
| 22 |
+
ckpt_path = hf_hub_download(repo_id="Bekhouche/ConflictAwareAH", filename="best_model.pt")
|
| 23 |
+
ckpt = torch.load(ckpt_path, map_location="cpu")
|
| 24 |
+
args = ckpt["args"]
|
| 25 |
+
|
| 26 |
+
# Infer fusion_type from checkpoint keys
|
| 27 |
+
state_keys = set(ckpt["model"].keys())
|
| 28 |
+
fusion_type = args.get("fusion_type") or ("6token" if any("fusion_transformer" in k for k in state_keys) else "concat")
|
| 29 |
+
|
| 30 |
+
model = ConflictAwareAHModel(
|
| 31 |
+
video_model=args["video_model"],
|
| 32 |
+
audio_model=args["audio_model"],
|
| 33 |
+
text_model=args["text_model"],
|
| 34 |
+
dropout=0.0,
|
| 35 |
+
freeze_encoders=args.get("freeze_encoders", True),
|
| 36 |
+
unfreeze_top_k=args.get("unfreeze_top_k", 0),
|
| 37 |
+
num_transformer_layers=args.get("num_layers", 2),
|
| 38 |
+
fusion_type=fusion_type,
|
| 39 |
+
)
|
| 40 |
+
model.load_state_dict(ckpt["model"], strict=True)
|
| 41 |
+
model.eval()
|
| 42 |
+
|
| 43 |
+
text_blend = ckpt.get("text_blend", args.get("text_blend", 0.5))
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Config
|
| 47 |
+
|
| 48 |
+
- Encoders: VideoMAE-Base, HuBERT-Base, RoBERTa-GoEmotions (frozen)
|
| 49 |
+
- Dropout: 0.4
|
| 50 |
+
- Text blend (inference): 0.5
|