Upload docs/run/spider.md with huggingface_hub
Browse files- docs/run/spider.md +91 -0
docs/run/spider.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Spider — Run Commands
|
| 2 |
+
|
| 3 |
+
## What this method does
|
| 4 |
+
Sampling-based retargeter (no RL). Simulator: **MuJoCo-Warp** (Python 3.12, CUDA 12.1). Produces per-cell scene.xml + kinematic trajectory + optional MJWP-sampled rollout. **No training** — this is the fundamental reason Spider is fast.
|
| 5 |
+
|
| 6 |
+
## 5-stage preprocess pipeline (per cell)
|
| 7 |
+
|
| 8 |
+
1. `process_datasets.oakink` — MANO → per-object keypoints + task_info.json
|
| 9 |
+
2. `preprocess.decompose_fast` — voxel-grid convex decomposition of object meshes
|
| 10 |
+
3. `preprocess.generate_xml` — assemble scene.xml + scene_eq.xml
|
| 11 |
+
4. `preprocess.ik_fast` — IK from MANO keypoints → trajectory_kinematic.npz (**CPU-only**)
|
| 12 |
+
5. `run_mjwp.py` — MuJoCo-Warp sampling → trajectory_mjwp.npz (**GPU-required**)
|
| 13 |
+
|
| 14 |
+
All 5 stages per cell via the canonical wrapper:
|
| 15 |
+
|
| 16 |
+
```bash
|
| 17 |
+
docker compose run --rm --entrypoint bash spider -c \
|
| 18 |
+
"bash /workspace/shared/scripts/spider_preprocess.sh \
|
| 19 |
+
/workspace/data/oakink_v2 <task> <hand> bimanual 0"
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
Where `<task>` is the traj name stripped of `_bimanual` (e.g. `lift_board`).
|
| 23 |
+
|
| 24 |
+
## Run one eval cell
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
./scripts/run.sh spider \
|
| 28 |
+
--hand {allegro|inspire|schunk|xhand} \
|
| 29 |
+
--dataset oakink_v2 \
|
| 30 |
+
--traj <traj-id> \
|
| 31 |
+
--seed 0 \
|
| 32 |
+
--warmstart default \
|
| 33 |
+
--viz none --dev
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
Example:
|
| 37 |
+
```bash
|
| 38 |
+
./scripts/run.sh spider --hand schunk --dataset oakink_v2 \
|
| 39 |
+
--traj lift_board_bimanual --seed 0 --viz none --dev
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Batch preprocess + sample for ALL 28 cells
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# idempotent; skips cells that already have trajectory_mjwp.npz
|
| 46 |
+
nohup /tmp/spider_mjwp_batch.sh > /mnt/external/outputs/logs/spider_mjwp_batch/ALL.log 2>&1 &
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
Current state (as of last check):
|
| 50 |
+
- kinematic: 28/28 ✅
|
| 51 |
+
- mjwp: 28/28 ✅ (schunk + xhand finished; inspire gap batch in progress)
|
| 52 |
+
|
| 53 |
+
Budget: ~30 min/cell average (wide range: 7 min for simple tasks, 78 min for pick_spoon_bowl). Total for 28 cells ≈ 7–10 hr if everything is from scratch.
|
| 54 |
+
|
| 55 |
+
## Spider × Arctic (via patch, not default)
|
| 56 |
+
|
| 57 |
+
Upstream has no arctic process_datasets. `methods/spider/patches/arctic_support.patch` adds `spider/process_datasets/arctic.py` + arctic hydra override — **partial**: keypoint extraction only, no scene-generation or mjwp arctic path yet. See `docs/46_gap_plan.md` Gap 3.
|
| 58 |
+
|
| 59 |
+
## Regenerate standardized video for all Spider cells
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
MUJOCO_GL=egl /home/azureuser/ckwolfe/benchmarking/.venv-shared/bin/python3 \
|
| 63 |
+
scripts/render_standardized.py --method-label spider
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
Outputs: `outputs/videos_std/spider_<run_id>.mp4`, 720×480 @ 30fps, BENCH_CAMERA front view.
|
| 67 |
+
|
| 68 |
+
The renderer prefers `trajectory_kinematic.npz` (uniform 2D qpos) over `trajectory_mjwp.npz` (receding-horizon planning tensor) for consistent rollout length across the grid.
|
| 69 |
+
|
| 70 |
+
## No training scripts
|
| 71 |
+
|
| 72 |
+
Spider is sampling-based; there is no `train.py` with `--train` flag beyond the MJWP sampling wrapper:
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
./methods/spider/scripts/train.py --hand <h> --traj <t>_bimanual \
|
| 76 |
+
--task full --train
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
`--task full` = preprocess + sample (stages 1-5). `--task preprocess` = stages 1-4 only (CPU-only). `--task sample` = stage 5 (GPU).
|
| 80 |
+
|
| 81 |
+
## Status check
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
python3 scripts/sanity_check.py | grep "oakink processed"
|
| 85 |
+
# expect:
|
| 86 |
+
# mano: 7/7 ✅
|
| 87 |
+
# allegro: kinematic=7/7, mjwp=7/7 ✅
|
| 88 |
+
# inspire: kinematic=7/7, mjwp=3/7 (or 7/7 if inspire batch finished)
|
| 89 |
+
# schunk: kinematic=7/7, mjwp=7/7 ✅
|
| 90 |
+
# xhand: kinematic=7/7, mjwp=7/7 ✅
|
| 91 |
+
```
|