Regen previews at 256-color palette; 3-cam dataloader gif; add docs/curation_pipeline.md
Browse files- docs/curation_pipeline.md +365 -0
- figures/dataloader_examples/sample_grid.png +2 -2
- figures/dataloader_examples/sample_window.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_000.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_001.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_002.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_003.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_004.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_005.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_006.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_007.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_008.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_009.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_010.gif +2 -2
- figures/episode_previews/motherboard/2026-05-10/episode_011.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_003.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_004.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_005.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_006.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_007.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_008.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_009.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_010.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_011.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_012.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_013.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_014.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_015.gif +2 -2
- figures/episode_previews/motherboard/2026-05-11/episode_016.gif +2 -2
- fig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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# React data curation pipeline
|
| 2 |
+
|
| 3 |
+
The procedure below is what runs between a fresh recording session and a HF
|
| 4 |
+
push. Follow it in order; each stage produces a checkable artifact, so a bad
|
| 5 |
+
stage doesn't silently propagate downstream.
|
| 6 |
+
|
| 7 |
+
Source files referenced. The first four live in the recording-machine
|
| 8 |
+
`MultimodalData/twm/` checkout. The last three are the curation scripts
|
| 9 |
+
produced for this dataset; they currently live in `/tmp/` (development
|
| 10 |
+
scratchpad) and should be moved into `MultimodalData/twm/twm/scripts/` so
|
| 11 |
+
they're versioned alongside the rest of the codebase.
|
| 12 |
+
|
| 13 |
+
| Script | Current location | Future home |
|
| 14 |
+
|---|---|---|
|
| 15 |
+
| `data_collection.py` | `MultimodalData/twm/` | (already in repo) |
|
| 16 |
+
| `compress_h5.py` | `MultimodalData/twm/` | (already in repo) |
|
| 17 |
+
| `visualize.py` | `MultimodalData/twm/` | (already in repo; projection overlay on by default, `--no_projection` to disable) |
|
| 18 |
+
| `twm.contact_index` | `MultimodalData/twm/twm/` | (already in repo) |
|
| 19 |
+
| `make_episode_gifs_v3.py` | `/tmp/` | `MultimodalData/twm/twm/scripts/` |
|
| 20 |
+
| `freeze_cut_report.py` | `/tmp/` | `MultimodalData/twm/twm/scripts/` |
|
| 21 |
+
| `inspect_short_freezes.py` | `/tmp/` | `MultimodalData/twm/twm/scripts/` |
|
| 22 |
+
|
| 23 |
+
The pipeline assumes the standard layout:
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
/media/yxma/Disk1/twm/
|
| 27 |
+
├── data/<task>/<date>/episode_*.h5 # raw H5 (BLOSC)
|
| 28 |
+
├── processed/<mode>/<task>/<date>/episode_*.pt # contact-indexed .pt
|
| 29 |
+
└── figures/
|
| 30 |
+
├── dataset_figures/ # summary plots + JSONs
|
| 31 |
+
└── episode_previews/<task>/<date>/ # one GIF per episode
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
`<date>` is `YYYY-MM-DD`; `<task>` is e.g. `motherboard`.
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## Stage 0 — Recording
|
| 39 |
+
|
| 40 |
+
Use `data_collection.py`. Confirm before you stop the run:
|
| 41 |
+
- All three RealSense cams are streaming (preview window shows three rows).
|
| 42 |
+
- Both GelSight feeds are alive.
|
| 43 |
+
- All three OptiTrack rigid bodies (left, right, work-piece) are tracked
|
| 44 |
+
for the whole take. If a body's pose stops updating mid-run, the
|
| 45 |
+
recorder will silently hold the last sample → this is the failure mode
|
| 46 |
+
detected in Stage 5C. Re-aim the cameras or re-seat the markers before
|
| 47 |
+
starting a long take.
|
| 48 |
+
- Audible buffer-drop warnings are zero in the last 30 s of the session.
|
| 49 |
+
|
| 50 |
+
Output: `data/<task>/<date>/episode_*.h5` (BLOSC-compressed).
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## Stage 1 — Integrity check
|
| 55 |
+
|
| 56 |
+
For every new H5, confirm it opens and that frame counts agree across
|
| 57 |
+
modalities. The fast version:
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
python - <<'PY'
|
| 61 |
+
import h5py, hdf5plugin, sys
|
| 62 |
+
from pathlib import Path
|
| 63 |
+
ROOT = Path("/media/yxma/Disk1/twm/data/motherboard/<date>")
|
| 64 |
+
for p in sorted(ROOT.glob("episode_*.h5")):
|
| 65 |
+
try:
|
| 66 |
+
f = h5py.File(p, "r")
|
| 67 |
+
T = f["realsense/cam0/color"].shape[0]
|
| 68 |
+
for k in ("realsense/cam1/color", "realsense/cam2/color",
|
| 69 |
+
"gelsight/left/frames", "gelsight/right/frames"):
|
| 70 |
+
assert f[k].shape[0] == T, (p, k, f[k].shape[0], T)
|
| 71 |
+
f.close()
|
| 72 |
+
print(f"OK {p.name} T={T}")
|
| 73 |
+
except Exception as e:
|
| 74 |
+
print(f"BAD {p.name} {e}")
|
| 75 |
+
p.rename(p.with_suffix(p.suffix + ".corrupt"))
|
| 76 |
+
PY
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Anything that fails to open is renamed `*.h5.corrupt` and excluded from the
|
| 80 |
+
rest of the pipeline.
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
## Stage 2 — Compression
|
| 85 |
+
|
| 86 |
+
BLOSC LZ4 is fast for recording but needs `hdf5plugin` at read time. Convert
|
| 87 |
+
to GZIP+shuffle for portability and ~30–50 % size savings:
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
python -m twm.compress_h5 \
|
| 91 |
+
--in_dir /media/yxma/Disk1/twm/data/motherboard/<date> \
|
| 92 |
+
--in_place
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
The script clamps chunk shapes when datasets are shorter than the default
|
| 96 |
+
chunk (relevant for short test recordings). Re-run integrity check after.
|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
+
|
| 100 |
+
## Stage 3 — Visual QA preview MP4 (per episode)
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
# Projection overlay is on by default; the default --cam_calib list already
|
| 104 |
+
# includes all three cameras.
|
| 105 |
+
python -m twm.visualize \
|
| 106 |
+
/media/yxma/Disk1/twm/data/motherboard/<date> \
|
| 107 |
+
--save_videos
|
| 108 |
+
|
| 109 |
+
# Same but no overlay (faster, useful for raw-stream sanity checks):
|
| 110 |
+
python -m twm.visualize \
|
| 111 |
+
/media/yxma/Disk1/twm/data/motherboard/<date> \
|
| 112 |
+
--save_videos --no_projection
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
These MP4s are for the operator only — scrub each one and flag:
|
| 116 |
+
- partial occlusions or out-of-frame moments,
|
| 117 |
+
- visible OT dropouts (the projection dot stays still while the hand moves),
|
| 118 |
+
- color/exposure problems,
|
| 119 |
+
- per-date "active sensors" (i.e. did you only use one side?).
|
| 120 |
+
|
| 121 |
+
Write findings into `tasks.json:per_date_notes.<date>`.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## Stage 4 — Contact indexing → `.pt`
|
| 126 |
+
|
| 127 |
+
Re-run for the new date:
|
| 128 |
+
|
| 129 |
+
```bash
|
| 130 |
+
python -m twm.contact_index \
|
| 131 |
+
--in_root /media/yxma/Disk1/twm/data/motherboard/<date> \
|
| 132 |
+
--out_root /media/yxma/Disk1/twm/processed/mode1_v1/motherboard/<date>
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
This downsamples cam0 to 128×128, builds the three contact metrics per side
|
| 136 |
+
(intensity / area / mixed), and stores reference-frame metadata in
|
| 137 |
+
`_contact_meta`. Reference strategy is `p01` (the 1st-percentile of
|
| 138 |
+
intensity over the whole episode), which is robust against early-frame
|
| 139 |
+
calibration drift.
|
| 140 |
+
|
| 141 |
+
Sanity check:
|
| 142 |
+
|
| 143 |
+
```bash
|
| 144 |
+
python - <<'PY'
|
| 145 |
+
import torch
|
| 146 |
+
p = "/media/yxma/Disk1/twm/processed/mode1_v1/motherboard/<date>/episode_006.pt"
|
| 147 |
+
ep = torch.load(p, weights_only=False)
|
| 148 |
+
print(list(ep.keys()))
|
| 149 |
+
print("T:", ep["view"].shape[0])
|
| 150 |
+
print("ref drift L/R:", ep["_contact_meta"]["drift_left"], ep["_contact_meta"]["drift_right"])
|
| 151 |
+
PY
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
If either drift > 5.0 the gel surface moved significantly between the
|
| 155 |
+
reference frame and the rest of the episode — flag the episode.
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
## Stage 5 — Automated failure-mode detection
|
| 160 |
+
|
| 161 |
+
Three failure modes are detected from the new `.pt` files and logged to
|
| 162 |
+
`figures/dataset_figures/bad_frames.json` + summarised in
|
| 163 |
+
`data_quality_breakdown.json`.
|
| 164 |
+
|
| 165 |
+
### 5A. Tactile intensity spikes (LED flicker)
|
| 166 |
+
|
| 167 |
+
A frame whose tactile intensity exceeds `p999 + 30 (uint8)` is treated as
|
| 168 |
+
a momentary LED dropout. Stored as `intensity_spikes: [[a, b], ...]` per
|
| 169 |
+
episode, with a 3-frame buffer on each side.
|
| 170 |
+
|
| 171 |
+
### 5B. Pose teleports
|
| 172 |
+
|
| 173 |
+
Per-frame OT velocity > 5 m/s → impossible motion → marker swap or brief
|
| 174 |
+
solver glitch. Stored as `pose_teleports_L` / `pose_teleports_R`.
|
| 175 |
+
|
| 176 |
+
### 5C. OptiTrack freezes (long held poses)
|
| 177 |
+
|
| 178 |
+
A sensor whose 7-vec pose is bitwise-identical across consecutive frames
|
| 179 |
+
for ≥ 1 s while that sensor is **active** for the date is treated as a
|
| 180 |
+
tracking loss. Threshold sweep at 1/2/5/10/30 s historically shows
|
| 181 |
+
near-identical totals (≈13 % of frames at any threshold ≥1 s), so 1 s is
|
| 182 |
+
the safe default. The cut intervals are written to `freeze_intervals.json`
|
| 183 |
+
and merged into `bad_frames.json`.
|
| 184 |
+
|
| 185 |
+
Today the three detectors live in separate one-off scripts:
|
| 186 |
+
- intensity spikes + pose teleports: the original detector that produced
|
| 187 |
+
the current `bad_frames.json`. To re-run incrementally, regenerate the
|
| 188 |
+
whole file from all `.pt` files; the script is not yet packaged but
|
| 189 |
+
follows the formula above.
|
| 190 |
+
- pose freezes: `/tmp/freeze_cut_report.py` (per-episode + per-threshold
|
| 191 |
+
totals across the whole task). For the per-interval list used by the
|
| 192 |
+
dataloader, run the unmerged-intervals path in
|
| 193 |
+
`/tmp/inspect_short_freezes.py`.
|
| 194 |
+
|
| 195 |
+
**To do — consolidation.** These three detectors should be merged into a
|
| 196 |
+
single `scripts/detect_failures.py` that:
|
| 197 |
+
1. iterates `.pt` files under a `--pt_root`,
|
| 198 |
+
2. applies all three detectors,
|
| 199 |
+
3. writes the union to `bad_frames.json` and a richer per-mode breakdown
|
| 200 |
+
to `freeze_intervals.json` and `data_quality_breakdown.json`,
|
| 201 |
+
4. emits the per-episode `data_quality_report.csv`.
|
| 202 |
+
|
| 203 |
+
Until that exists, the procedure is: re-run each of the three current
|
| 204 |
+
scripts in turn and merge their outputs by hand into `bad_frames.json`.
|
| 205 |
+
|
| 206 |
+
---
|
| 207 |
+
|
| 208 |
+
## Stage 6 — Visual QA gallery GIFs (for HF)
|
| 209 |
+
|
| 210 |
+
```bash
|
| 211 |
+
python /home/yxma/MultimodalData/twm/scripts/make_episode_gifs_v3.py \
|
| 212 |
+
--data_root /media/yxma/Disk1/twm/data/motherboard \
|
| 213 |
+
--pt_root /media/yxma/Disk1/twm/processed/mode1_v1/motherboard \
|
| 214 |
+
--out_root /media/yxma/Disk1/twm/figures/episode_previews/motherboard \
|
| 215 |
+
--tasks_json yxma_React/tasks.json
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
Settings (all configurable but the defaults are vetted):
|
| 219 |
+
- 60 frames evenly across [2 %, 98 %] of the episode
|
| 220 |
+
- 3 cameras shown left|middle|right with sensor projection overlay
|
| 221 |
+
- 256-color palette (preserves tactile gradients)
|
| 222 |
+
- ≤ 4 MB hard cap; on overflow the script first shrinks the spatial
|
| 223 |
+
resolution, then drops palette down to 128 colours, never below
|
| 224 |
+
- Output: one GIF per episode under
|
| 225 |
+
`figures/episode_previews/<task>/<date>/episode_*.gif`
|
| 226 |
+
|
| 227 |
+
These GIFs are uploaded to HF and rendered inline on the dataset card.
|
| 228 |
+
|
| 229 |
+
---
|
| 230 |
+
|
| 231 |
+
## Stage 7 — Per-event QA clips for borderline failures
|
| 232 |
+
|
| 233 |
+
Run only when Stage 5 flags something subtle (short freezes, weak intensity
|
| 234 |
+
spikes, single-frame teleports):
|
| 235 |
+
|
| 236 |
+
```bash
|
| 237 |
+
python /home/yxma/MultimodalData/twm/scripts/inspect_short_freezes.py \
|
| 238 |
+
--thr_min_s 1 --thr_max_s 5 \
|
| 239 |
+
--out_dir /media/yxma/Disk1/twm/figures/dataset_figures/freeze_check_short
|
| 240 |
+
```
|
| 241 |
+
|
| 242 |
+
Each event becomes one short GIF (~60 frames) with the affected sensor
|
| 243 |
+
circled red. The operator scans these and decides per-event whether to
|
| 244 |
+
keep, cut, or merge intervals. Final calls live in `freeze_intervals.json`
|
| 245 |
+
under a `manual_verdict: {"keep"|"cut"|"merge"}` field.
|
| 246 |
+
|
| 247 |
+
---
|
| 248 |
+
|
| 249 |
+
## Stage 8 — Update metadata
|
| 250 |
+
|
| 251 |
+
Touch three files before pushing to HF:
|
| 252 |
+
|
| 253 |
+
1. `tasks.json`
|
| 254 |
+
- Add the new date to `tasks.<task>.dates`.
|
| 255 |
+
- Add a `per_date_notes.<date>` block:
|
| 256 |
+
```json
|
| 257 |
+
{
|
| 258 |
+
"kind": "session",
|
| 259 |
+
"active_sensors": ["left", "right"],
|
| 260 |
+
"note": "human-readable summary, e.g. 'bimanual; one OT freeze in ep_017'"
|
| 261 |
+
}
|
| 262 |
+
```
|
| 263 |
+
- Update `n_episode_files`.
|
| 264 |
+
|
| 265 |
+
2. `bad_frames.json` — automatically refreshed by Stage 5.
|
| 266 |
+
|
| 267 |
+
3. `data_quality_breakdown.json` — automatically refreshed by Stage 5.
|
| 268 |
+
|
| 269 |
+
---
|
| 270 |
+
|
| 271 |
+
## Stage 9 — Docs refresh
|
| 272 |
+
|
| 273 |
+
If the new session adds material the dataset card or supporting docs
|
| 274 |
+
don't already describe, update:
|
| 275 |
+
- `README.md` "At a glance" counters (episodes, frames, duration).
|
| 276 |
+
- `docs/quality.md` if a new failure mode appeared, or percentages
|
| 277 |
+
changed by > 0.5 %.
|
| 278 |
+
- `docs/recording.md` if hardware / capture rate / sensor lineup changed.
|
| 279 |
+
- `docs/caveats.md` for any operator-noted anomaly.
|
| 280 |
+
|
| 281 |
+
---
|
| 282 |
+
|
| 283 |
+
## Stage 10 — Push to HF
|
| 284 |
+
|
| 285 |
+
Pre-flight check — these must all be true:
|
| 286 |
+
|
| 287 |
+
- [ ] every `episode_*.h5` has a matching `episode_*.pt`
|
| 288 |
+
- [ ] every `episode_*.pt` has been touched by `twm.contact_index` after
|
| 289 |
+
the most recent recording (timestamps, file size)
|
| 290 |
+
- [ ] `tasks.json:per_date_notes.<date>` exists
|
| 291 |
+
- [ ] `bad_frames.json:episodes.<date>/<ep>` exists for every episode
|
| 292 |
+
- [ ] every episode has a preview GIF under
|
| 293 |
+
`figures/episode_previews/<task>/<date>/`
|
| 294 |
+
- [ ] `data_quality_breakdown.json` reflects the new totals
|
| 295 |
+
|
| 296 |
+
Then upload:
|
| 297 |
+
|
| 298 |
+
```bash
|
| 299 |
+
python - <<'PY'
|
| 300 |
+
from huggingface_hub import upload_folder
|
| 301 |
+
upload_folder(
|
| 302 |
+
repo_id="yxma/React",
|
| 303 |
+
repo_type="dataset",
|
| 304 |
+
folder_path=".",
|
| 305 |
+
path_in_repo=".",
|
| 306 |
+
commit_message="Add <date> session + curation pipeline outputs",
|
| 307 |
+
)
|
| 308 |
+
PY
|
| 309 |
+
```
|
| 310 |
+
|
| 311 |
+
(Set `HF_HUB_ENABLE_HF_TRANSFER=1` for fast LFS uploads.)
|
| 312 |
+
|
| 313 |
+
---
|
| 314 |
+
|
| 315 |
+
## Failure-mode reference table
|
| 316 |
+
|
| 317 |
+
| Mode | Detector | Threshold | Where logged |
|
| 318 |
+
|---------------------|------------------------------------------------|------------------|-------------------------------------------|
|
| 319 |
+
| LED intensity spike | `tactile_<side>_intensity[t] - p999 > 30` | uint8 scale | `bad_frames.json:intensity_spikes` |
|
| 320 |
+
| Pose teleport | inter-frame velocity | > 5 m/s | `bad_frames.json:pose_teleports_{L,R}` |
|
| 321 |
+
| OT freeze | pose bitwise-identical for ≥ N frames | ≥ 1 s (≈30 fr.) | `bad_frames.json` + `freeze_intervals.json` |
|
| 322 |
+
| Contact-ref drift | `_contact_meta.drift_{side}` | > 5.0 | `_contact_meta` (per-episode .pt) |
|
| 323 |
+
| Color shift / hue | (manual; from Stage 3 MP4 review) | — | `tasks.json:per_date_notes.<date>.note` |
|
| 324 |
+
| Occlusion | (manual; from Stage 3 MP4 review) | — | same |
|
| 325 |
+
| Audio-buffer drops | (recorder logs at capture time) | — | recording-machine log |
|
| 326 |
+
|
| 327 |
+
---
|
| 328 |
+
|
| 329 |
+
## Quick "I'm adding one new date" runbook
|
| 330 |
+
|
| 331 |
+
```bash
|
| 332 |
+
DATE=2026-06-01
|
| 333 |
+
TASK=motherboard
|
| 334 |
+
|
| 335 |
+
# 1. integrity
|
| 336 |
+
python scripts/integrity_check.py data/$TASK/$DATE
|
| 337 |
+
|
| 338 |
+
# 2. compress
|
| 339 |
+
python -m twm.compress_h5 --in_dir data/$TASK/$DATE --in_place
|
| 340 |
+
|
| 341 |
+
# 3. preview MP4 (operator scrub)
|
| 342 |
+
python -m twm.visualize_projection data/$TASK/$DATE --save_videos
|
| 343 |
+
|
| 344 |
+
# 4. contact index → .pt
|
| 345 |
+
python -m twm.contact_index \
|
| 346 |
+
--in_root data/$TASK/$DATE \
|
| 347 |
+
--out_root processed/mode1_v1/$TASK/$DATE
|
| 348 |
+
|
| 349 |
+
# 5. detect failure modes
|
| 350 |
+
python scripts/detect_failures.py --date $DATE
|
| 351 |
+
|
| 352 |
+
# 6. gallery GIFs
|
| 353 |
+
python scripts/make_episode_gifs_v3.py --only_date $DATE
|
| 354 |
+
|
| 355 |
+
# 7. per-event clips (only if Stage 5 flagged subtle stuff)
|
| 356 |
+
python scripts/inspect_short_freezes.py --only_date $DATE
|
| 357 |
+
|
| 358 |
+
# 8/9. edit tasks.json + README + docs/* by hand
|
| 359 |
+
|
| 360 |
+
# 10. push
|
| 361 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 python scripts/push_hf.py
|
| 362 |
+
```
|
| 363 |
+
|
| 364 |
+
If any stage produces an unexpected count or a new failure mode, stop the
|
| 365 |
+
pipeline and write it up in `docs/caveats.md` before pushing.
|
figures/dataloader_examples/sample_grid.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/dataloader_examples/sample_window.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_000.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_001.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_002.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_003.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_004.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_005.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_006.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_007.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_008.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_009.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_010.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-10/episode_011.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_003.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_004.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_005.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_006.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_007.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_008.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_009.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_010.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_011.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_012.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_013.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_014.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_015.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_016.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
figures/episode_previews/motherboard/2026-05-11/episode_017.gif
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|