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
+
license: mit
|
| 3 |
+
pretty_name: FailBench RoboCasa v2 (contact prediction)
|
| 4 |
+
task_categories:
|
| 5 |
+
- robotics
|
| 6 |
+
tags:
|
| 7 |
+
- robotics
|
| 8 |
+
- manipulation
|
| 9 |
+
- failure-detection
|
| 10 |
+
- contact-prediction
|
| 11 |
+
- mujoco
|
| 12 |
+
- robocasa
|
| 13 |
+
- franka-panda
|
| 14 |
+
size_categories:
|
| 15 |
+
- 10K<n<100K
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# FailBench RoboCasa v2 — contact-prediction dataset
|
| 19 |
+
|
| 20 |
+
Labeled robot-failure trials built on **RoboCasa** kitchen demos (PandaMobile / Franka).
|
| 21 |
+
Each trial injects a hardware failure partway through a teleop/MimicGen demo, then records the
|
| 22 |
+
**contacts the failure causes** during a 1-second settle. The supervised target is a
|
| 23 |
+
**240×320 force-weighted contact heatmap** in the agentview camera — the model learns to predict
|
| 24 |
+
*where* a failure at a given pre-failure configuration will drive the robot/objects into contact.
|
| 25 |
+
|
| 26 |
+
Sibling dataset: [`aaronngx/failbench-libero-v2`](https://huggingface.co/datasets/aaronngx/failbench-libero-v2)
|
| 27 |
+
(identical schema, 240×320, LIBERO scenes). The two pool cleanly for cross-corpus training.
|
| 28 |
+
|
| 29 |
+
- **39,689 train trials** across **20 task files** (10 tasks × {human demos, MimicGen synthetic}).
|
| 30 |
+
- Also ships a few **held-out task files** (`TurnOffStove`, `TurnOnMicrowave`, `TurnOnStove_mg`) for
|
| 31 |
+
generalization eval — these are NOT in `manifest_train.csv`.
|
| 32 |
+
- One HDF5 per task under `v2/`; per-trial groups at `/trials/<trial_id>/`.
|
| 33 |
+
|
| 34 |
+
## ⚠️ The one gotcha: `import hdf5plugin` first
|
| 35 |
+
|
| 36 |
+
Arrays are **Blosc(lz4)-compressed** (third-party HDF5 filter id **32001**). Any reader must
|
| 37 |
+
`import hdf5plugin` **before** `h5py` opens a file, or reads fail with *"can't open plugin
|
| 38 |
+
directory"*. (`dataset.compression` reports `None` for this filter — misleading; it IS compressed.)
|
| 39 |
+
`pip install hdf5plugin` and import it first. The bundled `load_failbench.py` does this for you.
|
| 40 |
+
|
| 41 |
+
## Quick start
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
pip install -r requirements.txt
|
| 45 |
+
python -c "from huggingface_hub import snapshot_download as s; \
|
| 46 |
+
s('aaronngx/failbench-robocasa-v2', repo_type='dataset', local_dir='failbench-robocasa-v2')"
|
| 47 |
+
|
| 48 |
+
# load a trial + rebuild its contact target (pure h5py+numpy+scipy, no FailBench/MuJoCo):
|
| 49 |
+
python load_failbench.py --data_root failbench-robocasa-v2 \
|
| 50 |
+
--cache_root failbench-robocasa-v2/target_cache
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
### Standalone load snippet
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
import load_failbench as fb # imports hdf5plugin for you
|
| 57 |
+
df = fb.load_manifest("failbench-robocasa-v2") # the train manifest, as a DataFrame
|
| 58 |
+
row = df[df.n_contacts > 0].iloc[0]
|
| 59 |
+
trial = fb.read_trial(fb.resolve_h5("failbench-robocasa-v2", row.split, row.task), row.trial_id)
|
| 60 |
+
|
| 61 |
+
# (240,320) force-weighted contact heatmap = the prediction target:
|
| 62 |
+
target = fb.heatmap_from_projection("failbench-robocasa-v2/target_cache",
|
| 63 |
+
row.split, row.task, row.trial_id) # filtered (training)
|
| 64 |
+
# or rebuild from raw contacts + camera, no cache: fb.heatmap_from_contacts(trial)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Repo layout
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
v2/<task>.h5 # 22 task files (human; *_mg.h5 = MimicGen)
|
| 71 |
+
v2/manifest_train.csv # 39,689 train trials (use THIS for training)
|
| 72 |
+
v2/manifest.csv # full build incl. held-out + (pre-quarantine) rows
|
| 73 |
+
v2/quarantine.csv # excluded trial ids
|
| 74 |
+
target_cache/robocasa/<task>.h5 # per-trial /<trial_id>/projection (N,3)[u,v,force] + failure_prob attr
|
| 75 |
+
load_failbench.py requirements.txt examples/quickstart.py
|
| 76 |
+
planner/ scripts/ # the exact FailBench load+train code subtree (see "Train")
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
**Resolve files by `(split, task)` relative to your local root** — the manifest's `h5_path`
|
| 80 |
+
column holds the original build machine's absolute path and is not portable.
|
| 81 |
+
|
| 82 |
+
## Per-trial schema
|
| 83 |
+
|
| 84 |
+
Each `/trials/<trial_id>/` group. `T=8` window @ 4 fps; settle `S=50` steps (~1 s). Images are
|
| 85 |
+
**(H,W)=(240,320)**; depth is float16 metric.
|
| 86 |
+
|
| 87 |
+
| Key | Shape | Dtype | Meaning |
|
| 88 |
+
|---|---|---|---|
|
| 89 |
+
| `window_agentview_rgb` | (8,240,320,3) | u8 | pre-failure agentview window |
|
| 90 |
+
| `window_agentview_depth` | (8,240,320) | f16 | depth, metres |
|
| 91 |
+
| `window_wrist_rgb` / `_depth` | (8,240,320[,3]) | u8/f16 | wrist (`robot0_eye_in_hand`) window |
|
| 92 |
+
| `window_qpos` / `window_qvel` | (8,7) | f32 | arm joint pos/vel over window |
|
| 93 |
+
| `window_ee_pos` | (8,3) | f32 | end-effector xyz |
|
| 94 |
+
| `window_gripper_ctrl` | (8,·) | f32 | gripper command |
|
| 95 |
+
| `pre_rgb` / `pre_depth` | (240,320[,3]) | u8/f16 | single pre-failure frame (v1-compat) |
|
| 96 |
+
| `pre_qpos`/`pre_qvel`/`pre_ee_pos` | (7,)/(7,)/(3,) | f64 | pre-failure state |
|
| 97 |
+
| `goal_qpos`/`goal_qvel` | (k,7) | f32 | goal-conditioning frames |
|
| 98 |
+
| `contact_positions` | (N,3) | f32 | **world-frame** contact points during settle |
|
| 99 |
+
| `contact_force_world` | (N,3) | f32 | linear force, world frame (magnitude → heatmap weight) |
|
| 100 |
+
| `contact_forces` | (N,6) | f32 | contact-frame wrench (legacy; first 3 = linear) |
|
| 101 |
+
| `contact_time` | (N,) | i32 | settle step the contact occurred |
|
| 102 |
+
| `contact_geom_pairs` | (N,2) | i32 | colliding geom ids |
|
| 103 |
+
| `contact_failure_id` | (N,) | i32 | which failure caused it |
|
| 104 |
+
| `baseline_contact_geom_pairs` / `_positions` | (M,·) | i32/f32 | healthy-hold replay contacts (filter input) |
|
| 105 |
+
| `geom_bodyid` | (ngeom,) | i32 | geom→body map (body-level filter) |
|
| 106 |
+
| `robot_geom_ids` (attr) | (·,) | i32 | robot geom ids |
|
| 107 |
+
| `post_agentview_rgb`/`_depth`, `post_wrist_*` | (240,320[,3]) | u8/f16 | post-settle observation |
|
| 108 |
+
| `cam_agentview_pos`/`_mat0`/`_fovy`/`_size` | (3,)/(9,)/()/(2,) | f64/i32 | agentview pinhole calibration |
|
| 109 |
+
| `settle_qpos`/`qvel`/`gripper_qpos` | (50,·) | f32 | post-failure state trajectory |
|
| 110 |
+
| `settle_obj_pos`/`settle_obj_quat` | (50,nobj,·) | f32 | object pose trajectory |
|
| 111 |
+
| `obj_names` | (nobj,) | str | object body names |
|
| 112 |
+
|
| 113 |
+
Scalar attrs: `trial_id, split(="robocasa"), task, demo_key, seed, fail_idx, traj_progress,
|
| 114 |
+
failure_mode, failure_prob, is_holding`.
|
| 115 |
+
|
| 116 |
+
### Failure modes
|
| 117 |
+
`GRIPPER_OPEN`, `SINGLE_JOINT`, `MULTI_JOINT`, `ALL_JOINTS`, `SLIPPERY_GRIP`. Each trial samples
|
| 118 |
+
one mode at a stratified `traj_progress` (failure fraction along the demo); `failure_prob` is the
|
| 119 |
+
mode's prior, used as the per-trial heatmap weight.
|
| 120 |
+
|
| 121 |
+
### Camera
|
| 122 |
+
| Role | Camera | W×H |
|
| 123 |
+
|---|---|---|
|
| 124 |
+
| **agentview (target grid)** | `robot0_agentview_center` | **320×240** |
|
| 125 |
+
| wrist | `robot0_eye_in_hand` | 320×240 |
|
| 126 |
+
|
| 127 |
+
The contact heatmap is projected into `robot0_agentview_center`, so the (240,320) target IS the
|
| 128 |
+
prediction grid. For live eval, render that camera at 320×240 so recorded contacts line up with
|
| 129 |
+
the prediction. (LIBERO uses `agentview`/`eye_in_hand` — same resolution/semantics.)
|
| 130 |
+
|
| 131 |
+
## The target
|
| 132 |
+
|
| 133 |
+
`target_cache/robocasa/<task>.h5[<trial_id>]/projection` is `(N,3)=[u,v,force_mag]` of the
|
| 134 |
+
**failure-induced** in-frame contacts (static/baseline resting contacts removed by a two-stage
|
| 135 |
+
filter), plus a `failure_prob` attr. Rebuild the dense heatmap as
|
| 136 |
+
`scatter(force·failure_prob) → Gaussian blur(σ=4 px)` (`load_failbench.heatmap_from_projection`,
|
| 137 |
+
or `planner.risk.v2_targets.build_target_from_projection` on GPU). Pass `log1p=True` to match the
|
| 138 |
+
GPU training path's mass compression.
|
| 139 |
+
|
| 140 |
+
## Train (reproduce the in-repo benchmark model)
|
| 141 |
+
|
| 142 |
+
The bundled `planner/` + `scripts/benchmark/train_one.py` is the exact load+train subtree (pure
|
| 143 |
+
torch+torchvision; no MuJoCo). Targets are built on the fly — there is **no** `--target_cache_root`
|
| 144 |
+
flag.
|
| 145 |
+
|
| 146 |
+
```bash
|
| 147 |
+
PYTHONPATH=. python -m scripts.benchmark.train_one \
|
| 148 |
+
--robocasa_v2_root failbench-robocasa-v2/v2 \
|
| 149 |
+
--model unet --modalities state rgb --T 8 \
|
| 150 |
+
--split_by demo --epochs 10 --batch_size 64
|
| 151 |
+
# models: mlp | convdec | unet | transformer ; modalities: state goal rgb depth failure_mode ...
|
| 152 |
+
# pooled cross-corpus: add --v2_root <libero v2 root> --splits libero_spatial libero_object libero_goal
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
## License & attribution
|
| 156 |
+
|
| 157 |
+
Released under **MIT**. Built on **RoboCasa** (Nasiriany et al.), **MimicGen** (Mandlekar et al.),
|
| 158 |
+
and **robosuite** — please cite those works. Contact labels and the failure-injection pipeline are
|
| 159 |
+
from **FailBench**. Underlying demo content remains under its upstream RoboCasa license.
|