ZeyuLing commited on
Commit
6f35e65
·
verified ·
1 Parent(s): d73d1c1

Sync hftrainer model card for motionstreamer

Browse files
Files changed (1) hide show
  1. README.md +113 -21
README.md CHANGED
@@ -1,39 +1,131 @@
1
  ---
2
- license: apache-2.0
3
  library_name: hftrainer
4
- pipeline_tag: text-to-motion
5
  tags:
6
  - motion-generation
7
  - text-to-motion
8
- - autoregressive
9
- - diffusion
10
- - humanml3d
11
  - motionstreamer
 
 
12
  ---
13
 
14
- # MotionStreamer (hftrainer reproduction)
15
 
16
- Self-contained, `ref_repo`-independent reproduction of **MotionStreamer** (Xiao
17
- et al., ICCV 2025), packaged as an [hftrainer](https://github.com/) `ModelBundle`
18
- artifact. Causal TAE + LLaMA autoregressive transformer + per-token diffusion
19
- head are vendored in-tree; the `save_pretrained`/`from_pretrained` round-trip is
20
- **bit-identical**.
21
 
22
- - **Task:** Text-to-Motion · **Representation:** MotionStreamer-272 (30 fps)
23
- - **Text encoder:** SentenceT5-XXL (`sentence-transformers/sentence-t5-xxl`, frozen, reloaded by name)
24
- - **Paper:** [arXiv:2503.15451](https://arxiv.org/abs/2503.15451) · **Code:** https://github.com/zju3dv/MotionStreamer
 
 
 
 
25
 
26
- ## Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  ```python
29
- from hftrainer.models.motionstreamer import MotionStreamerBundle
30
  from hftrainer.pipelines.motionstreamer import MotionStreamerPipeline
31
 
32
- bundle = MotionStreamerBundle.from_pretrained("ZeyuLing/hftrainer-motionstreamer-humanml272", device="cuda")
33
- pipe = MotionStreamerPipeline(bundle, device="cuda")
 
 
34
  motions = pipe.infer_t2m(["a person walks forward then turns around"], [120]) # list of (T, 272)
35
  ```
36
 
37
- Files: `tae.safetensors` · `ar.safetensors` (LLaMA AR + diffusion head) ·
38
- `ms_config.json` · `Mean.npy` / `Std.npy`. The SentenceT5-XXL text encoder is
39
- reloaded by name and not duplicated here.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  library_name: hftrainer
3
+ pipeline_tag: other
4
  tags:
5
  - motion-generation
6
  - text-to-motion
 
 
 
7
  - motionstreamer
8
+ - humanml3d-272
9
+ license: other
10
  ---
11
 
12
+ <!-- This model card is synchronized from docs/model_zoo/motionstreamer.md by tools/sync_model_zoo_cards.py. -->
13
 
14
+ # MotionStreamer
 
 
 
 
15
 
16
+ Streaming/autoregressive text-to-motion baseline integrated into the hftrainer
17
+ Model Zoo. Our reproduction is **fully self-contained and independent of
18
+ `ref_repo`**: the causal TAE, the LLaMA autoregressive transformer, the
19
+ per-token diffusion head and the OpenAI-style Gaussian-diffusion sampler are all
20
+ vendored into `hftrainer.models.motion.motionstreamer._ms`. The `save_pretrained` /
21
+ `from_pretrained` round-trip is **bit-identical** (`max-abs-diff = 0.0` for both
22
+ the TAE and the AR weights).
23
 
24
+ | | |
25
+ |---|---|
26
+ | **Task** | Text-to-Motion (T2M) |
27
+ | **Bundle / Pipeline** | `MotionStreamerBundle` / `MotionStreamerPipeline` |
28
+ | **Processed HF artifact** | [`ZeyuLing/hftrainer-motionstreamer-humanml272`](https://huggingface.co/ZeyuLing/hftrainer-motionstreamer-humanml272) |
29
+ | **Motion representation** | **MotionStreamer-272** (272-dim, 30 fps) |
30
+ | **Text encoder** | SentenceT5-XXL (`sentence-transformers/sentence-t5-xxl`, frozen) |
31
+ | **Paper** | *MotionStreamer: Streaming Motion Generation via Diffusion-based Autoregressive Model*, 2025 — [arXiv:2503.15451](https://arxiv.org/abs/2503.15451) |
32
+ | **Original code** | https://github.com/zju3dv/MotionStreamer |
33
+
34
+ ---
35
+
36
+ ## Weights
37
+
38
+ Current hftrainer artifact (diffusers-style `from_pretrained`):
39
+
40
+ | Artifact | Location | Contents | Status |
41
+ |---|---|---|---|
42
+ | MotionStreamer HumanML3D-272 | [`ZeyuLing/hftrainer-motionstreamer-humanml272`](https://huggingface.co/ZeyuLing/hftrainer-motionstreamer-humanml272) | `tae.safetensors` + `ar.safetensors` + `ms_config.json` + `Mean.npy` / `Std.npy` | public Hub artifact; complete SentenceT5 packaging pending |
43
+ | local mirror | `checkpoints/motionstreamer/t2m_humanml272` | same layout | optional local cache |
44
+
45
+ **Use directly from the Hub:**
46
 
47
  ```python
 
48
  from hftrainer.pipelines.motionstreamer import MotionStreamerPipeline
49
 
50
+ pipe = MotionStreamerPipeline.from_pretrained(
51
+ "ZeyuLing/hftrainer-motionstreamer-humanml272",
52
+ device="cuda",
53
+ )
54
  motions = pipe.infer_t2m(["a person walks forward then turns around"], [120]) # list of (T, 272)
55
  ```
56
 
57
+ Complete text-encoder packaging is still pending for the current public
58
+ MotionStreamer artifact: the TAE/AR weights reload through
59
+ `MotionStreamerPipeline.from_pretrained`, but SentenceT5-XXL is currently
60
+ resolved by name rather than stored inside the repo.
61
+
62
+ **Or download to disk first:**
63
+
64
+ ```bash
65
+ huggingface-cli download ZeyuLing/hftrainer-motionstreamer-humanml272 \
66
+ --local-dir checkpoints/motionstreamer/t2m_humanml272
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Motion representation
72
+
73
+ **MotionStreamer-272**, a 272-dim global motion representation at 30 fps
74
+ (see the [272-dim representation repo](https://github.com/Li-xingXiao/272-dim-Motion-Representation)).
75
+ Generation path:
76
+
77
+ ```
78
+ text -> SentenceT5-XXL -> LLaMA AR (CFG, per-token diffusion sampling)
79
+ -> latent tokens (dim 16) -> causal TAE decoder (×4 upsample) -> 272-dim motion
80
+ ```
81
+
82
+ Convert to/from HumanML3D-263 with `hftrainer.motion.representation.convert`
83
+ (`hml263_to_motion272`, etc.).
84
+
85
+ ---
86
+
87
+ ## Evaluation
88
+
89
+ Generation pairs mirror `MotionStreamer272Evaluator.load_test_pairs()` (per
90
+ `(name, caption)` on the released `humanml3d_272` test split); each prediction is
91
+ scored against its GT/caption with the persisted MS-272 evaluator. Reproduce
92
+ with:
93
+
94
+ ```bash
95
+ # 1) generate (8-GPU sharded)
96
+ bash scripts/eval/_run_ms_h3d272_shards.sh
97
+ # 2) score
98
+ python3 scripts/eval/eval_ms_h3d272.py --pred_dir outputs/evaluation/ms_h3d272/ms_272
99
+ ```
100
+
101
+ ### MotionStreamer-272 evaluator (native space)
102
+
103
+ The hftrainer `MotionStreamer272Evaluator` is the same TMR-style evaluator used
104
+ in the paper (matching feature scale: MM-Dist ≈ 15, Diversity ≈ 27). Paper
105
+ numbers below are from the ICCV 2025 HumanML3D test-set table.
106
+
107
+ > _Full-set generation (7412 pairs, 8 GPUs) is in progress; the `hftrainer`
108
+ > column is filled in once scoring completes._
109
+
110
+ | Metric | hftrainer | MotionStreamer paper (ICCV'25) |
111
+ |---|---|---|
112
+ | FID ↓ | _pending_ | 11.790 |
113
+ | R-Precision Top-1 / 2 / 3 ↑ | _pending_ | 0.631 / 0.802 / 0.859 |
114
+ | MM-Dist ↓ | _pending_ | 16.081 |
115
+ | Diversity → | _pending_ | 27.284 |
116
+ | **GT(real)** FID / R@1 / R@3 / MM / Div | 0.0 / 0.706 / 0.911 / 15.01 / 27.36 | 0.002 / 0.702 / 0.914 / 15.151 / 27.492 |
117
+
118
+ The GT(real) row already reproduces the MotionStreamer paper *Real motion* row,
119
+ confirming the evaluator; the model row follows once generation finishes.
120
+
121
+ ---
122
+
123
+ ## Implementation notes
124
+
125
+ - **Vendored, ref_repo-independent**: `hftrainer/models/motionstreamer/_ms/` holds
126
+ `tae.py` / `causal_cnn.py` / `resnet.py` (causal TAE), `llama_model.py` (LLaMA
127
+ AR), `diffloss.py` + `diffusion/` (per-token diffusion head). Only relative
128
+ imports were changed from the upstream source.
129
+ - **Text encoder reloaded by name**: SentenceT5-XXL is frozen and not duplicated
130
+ into the artifact (like CLIP for MDM).
131
+ - **Guidance**: classifier-free, default scale `4.0`, token unit length `4`.