File size: 28,307 Bytes
aa991fc
 
0923e75
aa991fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2b3df95
 
 
 
 
aa991fc
 
b5d61f3
 
aa991fc
 
 
358e603
 
 
aa991fc
358e603
447349a
 
 
 
aa991fc
358e603
 
 
 
 
 
aa991fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a271655
aa991fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a271655
 
aa991fc
 
 
 
 
 
919e0dd
 
aa991fc
a271655
aa991fc
 
 
01eab39
 
 
 
 
 
 
 
 
 
 
 
 
 
358e603
 
 
 
 
 
 
 
aa991fc
358e603
 
 
 
 
aa991fc
358e603
 
aa991fc
 
 
 
 
 
 
 
358e603
 
aa991fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358e603
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa991fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358e603
 
 
aa991fc
358e603
aa991fc
 
 
358e603
 
 
 
 
 
aa991fc
 
 
 
 
358e603
aa991fc
 
 
358e603
aa991fc
 
358e603
 
aa991fc
 
 
 
 
 
 
 
 
676a17c
aa991fc
 
 
 
 
676a17c
 
 
aa991fc
 
 
 
676a17c
 
 
 
aa991fc
 
 
 
 
 
919e0dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a271655
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e26f649
 
 
 
 
 
 
 
 
 
 
 
cfadb70
 
 
 
a271655
b44eb69
 
 
e26f649
 
 
 
 
 
 
 
 
 
 
 
a271655
 
 
 
 
 
 
 
 
cfadb70
 
 
 
 
 
 
 
 
 
 
 
 
 
a271655
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa991fc
 
9ef6de2
b5d61f3
 
 
aa991fc
 
 
7d08051
aa991fc
 
 
 
 
2b3df95
aa991fc
 
 
 
 
 
2b3df95
a271655
 
aa991fc
0923e75
aa991fc
0923e75
 
 
 
aa991fc
5ee6314
0923e75
 
 
 
aa991fc
 
 
5ee6314
0923e75
aa991fc
2b3df95
e5edddc
 
 
 
0923e75
aa991fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
---
pretty_name: DREAMS-AVATAR
license: cc-by-nc-4.0
language:
- en
task_categories:
- image-to-3d
- keypoint-detection
tags:
- 3d
- avatar
- smplx
- multiview
- human-pose-estimation
- motion-capture
- degas
size_categories:
- n<1K
configs:
- config_name: default
  data_files:
  - split: train
    path: previews/**
---

# DREAMS-AVATAR

**The DREAMS-Avatar dataset from the [DEGAS](https://initialneil.github.io/DEGAS) paper
(3DV 2025), re-registered to pure SMPL-X.**

These are the same multiview captures introduced as the *DREAMS-Avatar dataset* in DEGAS
(Fig. 1b); what is new here is the registration.

32 calibrated, matted camera views of a full-body performance, with one SMPL-X body fitted
to all views at once by our multiview tracker: 300 shape coefficients, 100 expression
coefficients, jaw and both eyes, hands as free 45-dim axis-angle (`use_pca=False`).

3-panel QC on three held-out views of the same instant, `raw | omni-600 landmarks | SMPL-X overlay`:

![P1C1 f1399 cam03](https://huggingface.co/datasets/initialneil/DREAMS-AVATAR/resolve/main/assets/showcase/P1C1_f00001399_cam03.jpg)
![P1C1 f1399 cam06](https://huggingface.co/datasets/initialneil/DREAMS-AVATAR/resolve/main/assets/showcase/P1C1_f00001399_cam06.jpg)
![P1C1 f1399 cam12](https://huggingface.co/datasets/initialneil/DREAMS-AVATAR/resolve/main/assets/showcase/P1C1_f00001399_cam12.jpg)

One instant of `P1C1` (frame 1399, an open-hand gesture) through three of the 32 cameras:
a front face closeup, a full-body wide view, and a back-oblique view. It is the **same
single SMPL-X body** in all three. The hands are read from RGB (WiLoR) rather than zeroed,
and the face is driven by dense MediaPipe landmarks, which is what makes the 100 expression
coefficients observable at all.

> The caption burned into P1C1's QC renders reads one higher than the true frame
> (`f1400` here, and likewise in the `previews/` contact sheets). Those images were
> rasterised before the frame renumbering described below and were renamed rather than
> re-rendered. **The filenames and every metadata column are correct**; only the pixels
> carry the stale number. Captures other than P1C1 are unaffected.

Browse the fitted result frame by frame in the **Data** tab above: one row per
(capture x every 100th frame), each carrying the 32-view QC contact sheet.

---

## What is in here

| | |
|---|---|
| Captures | 10 (`P1C1`, `P1C2`, `P2C1`, `P2C2`, `P3C1`, `P3C2`, `P4C1`, `P4C2`, `P5C2`, `P6C2`) |
| Subjects | 6 (`P1`..`P6`) |
| Cameras per capture | 32, hardware-synchronised, calibrated, static |
| Image size | 2048 x 1500 RGB, matted (black background) plus a per-pixel alpha matte |
| Frame rate | 22 fps |
| Registration | pure SMPL-X, neutral, `num_betas=300`, `num_expression_coeffs=100`, `use_pca=False`, `flat_hand_mean=False`, `use_face_contour=True` |
| Face control | **both** paths shipped: the fitted SMPL-X expression + jaw, and per-frame 512-d DPE codes in `dpe/` ([details](#driving-the-face-smpl-x-expression-or-dpe-codes)) |
| Per capture | ~2 GiB of video + one consolidated `smplx.npz` + calibration + QC preview |

### How the captures are meant to be used

`Cy` is the session: **`C1` is the training capture, `C2` is the test capture** of the same
subject.

* **`P1`..`P4`** ship **both** sessions, so each of those subjects has a train capture and a
  held-out test capture.
* **`P5` and `P6`** are for **cross-reenactment only**: only their **`C2`** captures are
  included, as driving sequences to animate an avatar trained on somebody else. There are
  no `P5C1` / `P6C1` here (`P5C1` does not exist at all; `P6C1` is deliberately excluded).

| subject | C1 (train) | C2 (test / driving) | role |
|---|---|---|---|
| P1 | yes | yes | train + test |
| P2 | yes | yes | train + test |
| P3 | yes | yes | train + test |
| P4 | yes | yes | train + test |
| P5 | not included | yes | cross-reenact driving only |
| P6 | not included | yes | cross-reenact driving only |

---

## Layout

```
data/<PxCy>/
  videos/cam00.mp4 ... cam31.mp4   32 matted H.264 videos, 4096x1500 side-by-side
  smplx.npz                        our SMPL-X registration, all frames stacked
  cameras.json                     the capture calibration (32 rigs x 1 camera)
  capture.json                     machine-readable capture card (sizes, conventions)
  preview.jpg                      one 32-view QC contact sheet
  dpe/dpe-multi-faces.zip          per-frame DPE expression codes (optional face path)
  dpe/dpe_meta.json                which cameras, reference frame, crop, per-cam stats
previews/
  <PxCy>_f<frame:08d>.jpg          QC contact sheets, one per sampled frame
  metadata.jsonl                   the table rendered in the Data tab
assets/showcase/                   the 3-panel images used above
scripts/
  load_capture.py                  minimal reader: videos + smplx + cameras
  dreams_to_actorshq.py            convert a capture into an ActorsHQ-format tree
  verify_alignment.py              re-measure the video<->SMPL-X frame offset
  prepare_training.py              decode into an AvatarReX / DEGAS training layout
  extract_dpe_codes.py             regenerate the DPE codes yourself
  upload_capture.sh                packaging + upload pipeline (for maintainers)
```

### The Data tab

`previews/metadata.jsonl` is loaded by the `imagefolder` builder, so the **Data** tab is a
browsable index of every fitted frame that has QC output: one row per
(capture x every 100th frame), with the 32-view contact sheet as the `image` column plus

`capture`, `subject`, `session`, `role`, `frame`, `video_frame`, `n_cams`, `n_frames`,
`n_views_fit` (views the fit actually used), `n_face_views` (views with an accepted face
crop), `stages` (`A+B+C+F` cold start / `W` warm), `joint_span_y_m` (vertical extent of the
SMPL-X joints, a cheap "did the fit explode" number rather than a body height), and the
repo-relative paths to the full-resolution `videos` / `smplx` / `cameras`.

Sort or filter on `n_face_views` or `joint_span_y_m` to find the frames worth inspecting.

### `videos/camNN.mp4` carries two things

Each file is **4096 x 1500** and is published **uncropped on purpose**:

| half | pixels | what it is |
|---|---|---|
| **left** | `0..2047` | the matted RGB image (black background) |
| **right** | `2048..4095` | the **alpha matte**: a binary silhouette registered to the colour half within a few pixels, replicated over 3 channels |

The right half is the **foreground mask that avatar training needs**, not a rendering
artifact, so it is shipped as data. Do not crop the videos to the left half when
re-packaging. `scripts/load_capture.py` returns `(rgb, alpha)` from one decode, and
`scripts/prepare_training.py` splits them into `<frame>.jpg` and `mask/<frame>.png`
(masks are emitted **by default**).

The calibration `(fx, fy, cx, cy, w=2048, h=1500)` refers to the left half; both halves
share it, pixel for pixel. Camera index `NN` corresponds to `cameras.json -> rigs[NN].cameras[0]`.

### `smplx.npz`

Every per-frame fit stacked over time, bit-identical to what the tracker wrote (no
downcasting, no re-quantisation):

| key | shape | notes |
|---|---|---|
| `frames` | `(T,)` int32 | 0-based frame id. This is the index everything else is keyed by. |
| `video_frames` | `(T,)` int32 | equal to `frames` (d=0); shipped so no offset has to be remembered |
| `global_orient` | `(T,3)` float32 | axis-angle, world frame |
| `body_pose` | `(T,63)` float32 | 21 joints, axis-angle |
| `jaw_pose` | `(T,3)` float32 | |
| `leye_pose`, `reye_pose` | `(T,3)` float32 | driven by the MediaPipe iris landmarks |
| `left_hand_pose`, `right_hand_pose` | `(T,45)` float32 | full axis-angle, **not** PCA |
| `betas` | `(T,300)` float32 | shape (constant over a capture) |
| `expression` | `(T,100)` float32 | |
| `transl` | `(T,3)` float32 | |
| `joints` | `(T,144,3)` float32 | SMPL-X joints in world coordinates, shipped for convenience |
| `view_ids` | `(T,Vmax)` int16 | which cameras the fit actually used at that frame, `-1` padded |
| `n_views`, `n_face_views` | `(T,)` int16 | views used / views with an accepted face crop |
| `stages` | `(T,)` str | fit schedule at that frame (`A+B+C+F` cold start, `W` warm) |
| `smplx_kwargs` | scalar str | JSON, the exact `smplx.SMPLX(...)` constructor arguments |
| `meta` | scalar str | JSON, capture-level provenance |

Vertices are **not** shipped (they are a deterministic function of the parameters, and
would add ~200 MB per capture). Rebuild them with the `smplx_kwargs` above; the SMPL-X body
model itself must be obtained from [smpl-x.is.tue.mpg.de](https://smpl-x.is.tue.mpg.de)
under its own licence.

### Conventions you need to get right

**Frames: there is no offset (d = 0), uniformly, for every capture.**

```
smplx.npz["frames"][i]  ==  0-based frame index in videos/camNN.mp4  ==  GT frame index
```

One number indexes everything. `smplx.npz["video_frames"]` is shipped as an explicit
column and is equal to `frames`, so a reader never has to remember whether an offset
applies.

> **History, because it cost us a day.** P1C1 was first tracked assuming `GT = video + 1`.
> That offset had been measured on a near-static frame, where every candidate offset looks
> identical, and it was wrong. Re-measured on high-motion frames against the alpha matte,
> the true offset is 0, and P1C1's fits were renumbered from `1..1836` to `0..1835`
> accordingly. A one-frame error is nearly invisible in a still overlay and poisons every
> downstream avatar, so the offset is now **measured per capture, never assumed**:
> `scripts/verify_alignment.py` re-derives it from the shipped files alone and refuses to
> answer when the window it was given cannot resolve it.
>
> If you pulled P1C1 before this renumbering, re-download `data/P1C1/smplx.npz`. The
> videos and calibration never changed.

**Cameras.** `cameras.json` is nested (`rigs[i].cameras[0]`) and its world is **Y-down**,
while SMPL-X is Y-up. The registration lives in the flipped, Y-up world, so:

```python
A     = np.diag([1.0, -1.0, -1.0])          # world_flip
K     = [[fx, 0, cx], [0, fy, cy], [0, 0, 1]]
R_w2c = R @ A
t_w2c = -R @ c                              # c = camera centre as stored in cameras.json
x_cam = R_w2c @ x_world + t_w2c
uv    = (K @ x_cam)[:2] / x_cam[2]
```

`scripts/load_capture.py` does exactly this; `scripts/prepare_training.py` bakes the flip
into the emitted `calibration_full.json` so downstream training code never sees it.

Distortion `D` is all-zero for these captures (the images ship undistorted).

---

## Quickstart

```bash
pip install huggingface_hub numpy opencv-python
huggingface-cli download initialneil/DREAMS-AVATAR --repo-type dataset \
    --include "data/P1C1/*" "scripts/*" --local-dir ./DREAMS-AVATAR
```

```python
import sys; sys.path.append("DREAMS-AVATAR/scripts")
from load_capture import Capture

cap = Capture("DREAMS-AVATAR/data/P1C1")
print(cap)                                    # 32 cams, 1836 frames, 2048x1500

# `frame` is the same number as the mp4 frame index: no offset, ever.
rgb, alpha = cap.read_frame("cam03", frame=1399)   # (1500,2048,3), (1500,2048)
uv = cap.cameras["cam03"].project(cap.joints(frame=1399))   # (144,2) pixels

params = cap.smplx_params(frame=1399)         # 10 arrays, each (1, D)
print(cap.smplx_forward_kwargs)               # feed straight into smplx.SMPLX(...)
```

Re-derive the frame offset yourself, from the shipped files only:

```bash
python scripts/verify_alignment.py data/P1C1 --cams 6 12 --start 1300 --count 250 --expect 0
```

Rebuilding the mesh:

```python
import smplx, torch
m = smplx.SMPLX(model_path="<your SMPLX dir>", batch_size=1, **cap.smplx_forward_kwargs)
out = m(**{k: torch.from_numpy(v) for k, v in cap.smplx_params(1399).items()})
verts = out.vertices[0].numpy()               # (10475,3) in the same world as the cameras
```

Sequential decode is far cheaper than seeking, and gives you the matte for free:

```python
for frame, rgb, alpha in cap.iter_frames("cam03", start=0, end=200):
    ...                                       # alpha is the mp4's right half
```

## Preparing avatar-training input

`scripts/prepare_training.py` turns a capture into the flat, per-camera-folder layout that
the DEGAS / AvatarReX style trainers expect:

```bash
python scripts/prepare_training.py data/P1C1 --out /scratch/train/P1C1 \
       --stride 4 --cams 0 3 6 9 12 15 18 21 --workers 8
```

```
/scratch/train/P1C1/
  calibration_full.json      {"cam00": {K, R, T, RT, imgSize, ...}}   world-to-camera, Y-up
  cam_cam00/00000000.jpg     RGB from the mp4's LEFT half, named by frame id
  cam_cam00/mask/00000000.png  alpha matte from the RIGHT half
  smplx/00000000.npz         per-frame params, (1,D)
  smplx_params.npz           the same params stacked
  meta.json
```

Masks are written **by default** (the matte is a training input); pass `--no-masks` to skip
them. The world Y-flip is baked into `calibration_full.json`, so the trainer never sees the
DEGAS calibration quirk.

This is the **proposed** training contract. Key names and the image/mask split will be
reconciled against the training code in the retrain phase; re-emitting after a format
change costs one ffmpeg pass per camera.

---

## Prepare for an ActorsHQ loader

Most full-body avatar codebases already read the **ActorsHQ** layout. `scripts/dreams_to_actorshq.py`
writes one, so an *unmodified* ActorsHQ reader can train on DREAMS-AVATAR without knowing
anything about mp4 halves or Y-down calibration.

### 1. Download

```bash
pip install "huggingface_hub[cli]" numpy opencv-python torch      # torch only for the .pt
huggingface-cli download initialneil/DREAMS-AVATAR --repo-type dataset \
    --local-dir ./DREAMS-AVATAR
```

One capture is ~2 GiB, so pull only what you need:

```bash
huggingface-cli download initialneil/DREAMS-AVATAR --repo-type dataset \
    --include "data/P1C1/*" "scripts/*" --local-dir ./DREAMS-AVATAR
```

Equivalent from Python:

```python
from huggingface_hub import snapshot_download
snapshot_download("initialneil/DREAMS-AVATAR", repo_type="dataset",
                  allow_patterns=["data/P1C1/*", "scripts/*"],
                  local_dir="./DREAMS-AVATAR")
```

`load_dataset("initialneil/DREAMS-AVATAR")` gives you the **QC preview index only** (the
`imagefolder` build over `previews/`) — it is for browsing in the Data tab, not for
training. Training needs the files on disk, so use `huggingface-cli download` /
`snapshot_download`.

### 2. Convert a capture

```bash
cd DREAMS-AVATAR
python scripts/dreams_to_actorshq.py --capture-dir data/P1C1 --out actorshq/P1C1
```

Needs `ffmpeg` on `PATH`. Full-resolution, all 32 cameras, all 1836 frames is ~59k images;
subset while you are still wiring things up:

```bash
python scripts/dreams_to_actorshq.py --capture-dir data/P1C1 --out actorshq/P1C1 \
    --scale 2x --stride 4 --cams 0 2 4 6 8 10 12 14 --workers 8 \
    --smplx-model-dir /path/to/smplx --verify
```

| flag | effect |
|---|---|
| `--scale 1x\|2x\|4x` | image size: `2048x1500` / `1024x750` / `512x375`. `calibration.csv` stores focal and principal point **normalised**, so the same rows are valid at every scale; only `w,h` change. Default `2x`. |
| `--stride`, `--frames A B` | frame subset (frame ids, not row numbers) |
| `--cams` | which cameras to **decode**. `calibration.csv` always holds all 32 (see the warning below). |
| `--smplx-model-dir` | dir with `SMPLX_NEUTRAL.npz`; lets the compat `.npz` fold in `hands_mean` |
| `--verify` | re-projects the SMPL-X joints through `cameras.json` and through the emitted csv and fails if they disagree by more than 1e-3 px |
| `--no-masks`, `--no-images` | skip the alpha mattes / skip decoding entirely |

Output:

```
actorshq/P1C1/
  2x/
    calibration.csv                        ActorsHQ convention, all 32 cameras
    rgbs/Cam001/Cam001_rgb000000.jpg  ...   the mp4's LEFT half
    masks/Cam001/Cam001_mask000000.png ...  the mp4's RIGHT half (alpha matte)
  smplx_dreams.pt                          SMPL-X, lossless, with model metadata
  smpl_params.npz                          SMPL-X, float arrays only (compat)
  dreams_meta.json                         what was emitted, and under which conventions
```

### 3. Point the loader at it

`calibration.csv` is exactly Synthesia's:

```
name,w,h,rx,ry,rz,tx,ty,tz,fx,fy,px,py
```

`(rx,ry,rz)` is the axis-angle of the **camera-to-world** rotation, `(tx,ty,tz)` is the
**camera centre in world space**, and `fx,fy,px,py` are **normalised** by `w,h`
(`fx_pixels = fx * w`). That is what `actorshq.dataset.camera_data.read_calibration_csv`
expects, and what DEGAS's own `read_ActorsHQ_cameras` reconstructs as
`R = Rodrigues(rvec).T`, `c = (tx,ty,tz)`.

> **Camera numbering.** ActorsHQ readers derive the image folder from the calibration
> **row index** (`Cam%03d % (i+1)`), not from the `name` column. So the csv is always
> written **dense**: row `i` is DREAMS `cam{i:02d}` is `Cam{i+1:03d}`, whether or not that
> camera was decoded. A 1-based `cam_select` in your config therefore means what it looks
> like it means. Do not filter rows out of the csv.

SMPL-X is not part of the ActorsHQ spec (ActorsHQ ships none), so two files are written:

* **`smplx_dreams.pt`** — `torch.load` → dict. Lossless: keeps `flat_hand_mean=False`,
  `num_betas=300`, `num_expression_coeffs=100`, plus `gender`/`model_type`/`use_pca`.
  **Prefer this one.** In DEGAS: `smplx_type: smplx_dreams.pt`.
* **`smpl_params.npz`** — float arrays only, the AnimatableGaussians-style file some
  readers insist on. An `.npz` cannot carry the model metadata (a loader that turns every
  array into a tensor chokes on strings and 0-d scalars), which costs two things:
  `flat_hand_mean` is assumed `True`, so `hands_mean` is **folded into the hand poses**
  (needs `--smplx-model-dir`); and `num_expression_coeffs` cannot be expressed, so
  `expression` is **omitted** by default (`--npz-expression-coeffs 10` writes the leading
  10 instead). Geometry is otherwise identical; only the face is dropped.

Both are indexed so that **row index == frame id**, matching the `%06d` in the image
filenames, because ActorsHQ-style loaders index the SMPL-X arrays with the raw frame
number.

### Things worth knowing before you start

* **`videos/camNN.mp4` is 4096x1500 and holds two images**: LEFT 2048 = matted RGB,
  RIGHT 2048 = the alpha matte. The converter splits them into `rgbs/` and `masks/`.
* **There is no frame offset (d = 0)**: `smplx.npz["frames"][i]` is the mp4 frame index is
  the number in the emitted filenames. Re-derive it yourself with
  `scripts/verify_alignment.py`.
* **`C1` is the train capture and `C2` the test capture** of the same subject. Convert both
  and hold `C2` out; `P5`/`P6` ship `C2` only, as cross-reenactment driving sequences.
* The world is **Y-up** everywhere in the emitted tree — the `cameras.json` Y-down flip is
  baked into the calibration, so cameras and SMPL-X share one frame.

### Not using ActorsHQ? DEGAS reads this dataset natively

If you are training [DEGAS](https://initialneil.github.io/DEGAS) itself, there is no need
to convert or to duplicate ~40 GB of jpgs. DEGAS has a `frameset_type: dreams` reader that
consumes `cameras.json` + `smplx.npz` + the mp4s directly and decodes only the
(camera, frame) pairs a split asks for into a local cache:

```yaml
dataset:
  dat_dir: /path/to/DREAMS-AVATAR/data/P1C1
  frameset_type: dreams
  scale: 2x
  resolution: 1
  train: {frm_list: np.arange(0, 1836, 4).tolist(), cam_select: [0, 2, 4, 6], mini_batch: 1}
```

`cam_select` is **0-based** there (`cam00`..`cam31`, matching the mp4 names), unlike the
1-based ActorsHQ path. The two paths are checked against each other: identical cameras,
byte-identical decoded RGB and masks, identical SMPL-X tensors.

---

## Driving the face: SMPL-X expression, or DPE codes

This dataset ships what you need for **both** ways of animating the face, and they are
mutually exclusive: pick one per training run.

### Path 1: the fitted SMPL-X expression (in `smplx.npz`)

`smplx.npz` carries a real 100-dim `expression` and a `jaw_pose` per frame, fitted from
dense MediaPipe face landmarks across every view that saw the face. Let them drive the
mesh and the posed geometry moves its own face; an appearance network conditioned on that
geometry sees the expression for free, with no extra input and no architecture change.

Nothing extra to download. In DEGAS this is `smplx_nofacial: ''`.

### Path 2: per-frame DPE expression codes (in `dpe/`)

This is the formulation in the DEGAS paper: **neutralize the mesh's face** and drive it
from a separate code instead. Two steps, and both are required:

1. Zero the mesh's facial parameters (`smplx_nofacial: exp+jaw`, plus
   `optim_skip: [expression, jaw_pose]` so they stay zero). The mesh then carries pose and
   identity but no facial motion at all.
2. Feed the decoder's 512-d face branch a per-frame code from `dpe/dpe-multi-faces.zip`.

```
dpe/dpe-multi-faces.zip     members  dpe-{frame:06d}-cam{cc:02d}.pt
                            each a dict {'exp': FloatTensor(1, 512)}
dpe/dpe_meta.json           cams, ref_frame, pad, dim, and per-camera statistics
```

The members are keyed by **frame id**, not by position in a split, so a code can never be
silently mis-paired with a frame when you change `frm_list`. Two cameras are stored per
frame; a loader is expected to concatenate them to `(N_faces, 512)` and sample a random
convex combination as augmentation.

| capture | codes | cameras | reference frame | expression range (per-dim std, cam07 / cam30) |
|---|---|---|---|---|
| P1C1 | 3672 | cam07, cam30 | 918 | 0.323 / 0.332 |
| P1C2 | 586 | cam07, cam30 | 146 | 0.171 / 0.229 |
| P2C1 | 3736 | cam07, cam30 | 934 | 0.248 / 0.247 |
| P2C2 | 800 | cam07, cam30 | 200 | **0.090 / 0.095** |
| P3C1 | 3664 | cam07, cam30 | 916 | 0.267 / 0.302 |
| P3C2 | 814 | cam07, cam30 | 203 | 0.243 / 0.366 |
| P4C1 | 3098 | cam07, cam30 | 774 | 0.291 / 0.347 |
| P4C2 | 526 | cam07, cam30 | 131 | 0.238 / 0.260 |
| P5C2 | 622 | cam07, cam30 | 155 | 0.149 / 0.180 |
| P6C2 | 350 | cam07, cam30 | 87 | **0.325 / 0.376** |

**All 10 captures are covered**, including `P5C2` and `P6C2`, the cross-reenactment driving
sequences, so an avatar can be driven by another subject's session on the DPE path as well
as on the SMPL-X one.

Counts are codes, not frames: each frame contributes one code per camera, so a capture of
*N* frames shot with two cameras yields 2*N*.

**Pick your driving sequence by that last column.** It is how much the expression code
actually moves over the capture, so it is a direct measure of how much facial motion there
is to transfer. Every `C2` is flatter than its own `C1` (they are short takes), but the
spread among them matters: **`P6C2` is the liveliest of all ten** and is the one to reach
for in a cross-reenactment demo, while **`P2C2` is by far the flattest** and will make any
expression-transfer method look like it is doing nothing. That is a property of the take,
not of the method.

**There is no `P5` or `P6` avatar, and there will not be one.** `P5C1` does not exist in
the source dataset and `P6C1` was excluded, so there is nothing to train those two subjects
on. Their `C2` captures exist precisely so they can *drive somebody else's* avatar.

**How they were made.** The code is `mlp_exp(dir(mlp(enc(face_crop))))` from
[OpenTalker/DPE](https://github.com/OpenTalker/DPE)'s `Generator(size=256, style_dim=512,
motion_dim=20)`. That is exactly the tensor DPE's own `dec_exp` consumes, so it carries
expression and nothing else, and 512 is exactly DEGAS's `n_face_embs`: nothing is reshaped,
padded or projected. `enc.net_app` takes a single image, so the code is an absolute
per-frame function with no reference frame to choose and no convention to get wrong. The
face box comes from S3FD on one reference frame, expanded by 50 px, then held fixed for the
sequence, matching DPE's own `crop_video.py`.

**The crop is a FIXED box, not per-frame tracking.** S3FD detects once on a reference
frame, the box is padded by 50 px per side, and that box is reused unchanged for the rest
of the sequence, which is what DPE's own `crop_video.py` does. A subject who moves
substantially out of that box degrades, and nothing re-detects to recover. The reference
frame is mid-sequence by default (`frames[len // 2]`), never hand-picked, and both the
frame and the resulting box are recorded per capture in `dpe_meta.json` (`ref_frame` and
`stats.<cam>.box`), so every published code set is reproducible from its own metadata.

**The per-camera mix is stochastic, and it runs at evaluation time too.** A loader is
expected to draw `w ~ U(0,1)^N`, normalise it, and return `einsum('i,ij->j', w, codes)`,
redrawn on every sample. In DEGAS that is exactly what `__getitem__` does, during training
*and* during evaluation, so DPE-driven evaluation is not deterministic across cameras. If
you need reproducible numbers, restrict the evaluation to a single camera per frame.

**Cameras 07 and 30 are frontal tele views, and both are inside the training split.** The
held-out evaluation camera (cam03, the frontal face closeup) is deliberately excluded, so
no evaluation pixels leak into the face conditioning. Keep that property if you regenerate:

```bash
python scripts/extract_dpe_codes.py --capture data/P1C1 --cams 7 30 --out data/P1C1/dpe
```

**Driving one session with another session's codes is a bug, not a feature.** When you
evaluate a P1C1-trained avatar on P1C2, point the loader at `data/P1C2/dpe/`, or you will
render P1C2's poses with P1C1's expressions.

In DEGAS, `with_face_dpe` resolves relative to `dat_dir` and accepts a directory, so
`with_face_dpe: dpe` is the whole configuration.

---

## How the registration was produced

Our multiview SMPL-X registration (release pending). The fitted
result is what this dataset ships, so you do not need the tracker itself to use the data.
One SMPL-X body, N calibrated views, minimising the summed 2D reprojection error rather
than fitting a visual hull:

| part | predictor |
|---|---|
| body | sapiens-omni-600, 600 dense 2D surface landmarks |
| hands | [WiLoR](https://github.com/rolpotamias/WiLoR), reprojected as a vertex-to-vertex term (MANO is the SMPL-X hand submesh) |
| face | MediaPipe FaceLandmarker, 105 embedded points plus 10 iris points |

Sequence mode warm-starts frame `N` from frame `N-1` and only cold-starts the first frame of
a shard, so a ~1800 frame capture is practical. FLAME and joint offsets are off: this is
native SMPL-X, matching [DEGAS](https://initialneil.github.io/DEGAS).

The `previews/` contact sheets and the 3-panel images above are the tracker's own QC output,
rendered on every 100th frame with the mesh rasterised through the true calibrated camera.

## Related

- [DEGAS](https://initialneil.github.io/DEGAS): Detailed Expressions on Full-Body Gaussian Avatars (3DV 2025), which introduced these captures as the DREAMS-Avatar dataset
- [DEGAS code](https://github.com/initialneil/DEGAS): training and evaluation, reads this dataset natively via `frameset_type: dreams`
- [DEGAS pretrained avatars](https://huggingface.co/initialneil/DEGAS): avatars trained on these captures, for both face paths

## Licence

**[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)** (Creative Commons
Attribution-NonCommercial 4.0 International). Free to use, share, and adapt for
non-commercial research with attribution; commercial use is prohibited. Full text in
[`LICENSE`](LICENSE).

Attribution: cite the DEGAS paper (see the citation below).

The SMPL-X body model is **not** included in this repository. It must be obtained from
[smpl-x.is.tue.mpg.de](https://smpl-x.is.tue.mpg.de) and stays under its own licence from
the Max Planck Institute; nothing here grants any right to it.

## Citation

Please cite the DEGAS paper.

```bibtex
@inproceedings{shao2025degas,
  title = {{DEGAS: Detailed Expressions on Full-Body Gaussian Avatars}},
  author = {Zhijing Shao and Duotun Wang and Qing-Yao Tian and Yao-Dong Yang and Hengyu Meng and Zeyu Cai and Bo Dong and Yu Zhang and Kang Zhang and Zeyu Wang},
  booktitle = {Proceedings of the International Conference on 3D Vision (3DV)},
  year = {2025}
}
```