Run this model with HF Jobs
Run siyuhsu/openpi_lab on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/siyuhsu/openpi_lab. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/siyuhsu/openpi_lab on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use siyuhsu/openpi_lab with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use siyuhsu/openpi_lab with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Model card: cover both robots (G2 + Piper)
Browse files5 unmodified lines67891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121135 unmodified lines- openpi- pi0- lerobot- bimanual- manipulationlibrary_name: openpipipeline_tag: robotics---# G2 Dual-Arm — π₀ policy + LeRobot datasetA π₀ (pi0) vision-language-action policy trained on an **AgiBot G2** dual-arm robot, togetherwith the dataset it was trained on. The policy runs closed-loop on the real robot from livecamera observations and completes the task.**Task:** `Make a yogurt bowl with cereal and fruit.`| | ||---|---|| Robot | AgiBot G2, dual 7-DOF arms + 2 grippers || Action / state | 16-D `[L_j1..j7, L_grip, R_j1..j7, R_grip]`, **absolute joint radians** + boolean gripper || Cameras | `head` (400×640), `hand_left` / `hand_right` (528×640), RGB || Control rate | **10 Hz** (dataset fps); robot servo runs at 30 Hz || Action chunk | 50 |## Contents```params/ π₀ weights (12 GB, JAX/orbax)assets/ norm stats bundled with the checkpoint_CHECKPOINT_METADATAdataset/g2_dualarm_yogurt_rs10/ LeRobot v2.1 — 58 episodes / 48,332 frames / 10 Hz```## Training| | ||---|---|| Config | `pi0_g2_dualarm` (openpi) || Steps | 30,000, batch 32, 1× H200 || Wall time | 17 h 06 m || Final loss | 0.0047 (from 0.3207) |Actions are converted to deltas at train time via `make_bool_mask(7, -1, 7, -1)` — 7 jointdims as deltas, gripper kept absolute, per arm.## Dataset notes (read before training on it)* **`_rs10` = resampled to a uniform 10 Hz grid.** The raw recordings are badly jittered(only 13.6% of inter-frame gaps fall within ±20% of the median) because the on-robot*disk writer* — not the cameras or the control loop — is the bottleneck: the control loopruns at a rock-steady 29.5–29.9 Hz and the cameras at ~30 Hz, but 60–65% of frames aredropped before they reach disk. Naive contiguous re-indexing distorts episode duration by−18%…+35%; the resampled variant is accurate to +0.06%.* **The right gripper's position sensor is dead** (constant 0.2173 across all 60 episodes),so both gripper dims come from the *command* boolean, not from a sensor.* **Gripper polarity in this dataset: `1.0` = OPEN, `0.0` = CLOSED.** The underlying rawfield is named `gripper_closed`, and **the name is backwards relative to the physicalbehaviour**. Verified from the physical semantics: in episode 27 the right gripper dimflips `1.0 → 0.0` at step 54, exactly as the right arm reaches its deepest point — thegrasp. If you drive real hardware, confirm your wire convention separately; on this robotthe DDS tool wire is the opposite (`1.0` = CLOSED), so the mapping is an inversion.* 2 of 60 recorded episodes are excluded (camera dropouts mid-episode, broken on the robot).## EvaluationOffline replay against a live server, 120 frames over 12 episodes:| metric | value | threshold ||---|---|---|| joint MAE | **0.28°** (worst 0.95°) | < 5° || gripper agreement | **99.8%** | > 90% || delta direction cosine | **0.999** | > 0.8 || first-step jump | 1.47° (worst 5.43°) | worst < 15° |On real hardware the policy was validated in four stages — dry-run → ground-truth replay →policy-replay on dataset observations → live closed loop — and completes the task in thelast stage.## Using the weights```bash# serve (openpi)python examples/g2_dualarm/g2_serve_openpi.py \--config pi0_g2_dualarm --ckpt-dir <this repo>/ --port 8000```The server publishes the deployment contract in its connect-time metadata:`action_chunk_size=50`, `action_rate_hz=10.0`, `robot_servo_hz=30.0`,`action_space="absolute_joint_rad_plus_gripper_cmd"`, plus a `reset_pose`.> ⚠️ **Advance the chunk at 10 Hz, not at the servo rate.** Actions are absolute joint> targets; stepping them at 30 Hz executes the trajectory 3× too fast.## Caveats* Single task, single scene, 58 demonstrations. Expect it to be brittle outside therecorded prop layout.* The policy is stochastic (flow matching): identical input gives joint outputs differingby ~1.2°. Do not use repeated inference as a determinism check.* **Do not JPEG-compress observations to save bandwidth.** Measured on this checkpoint,JPEG q92/q85 flips the *gripper decision* outright (|Δ| = 1.007 on a boolean dim, 3 of 6trials) while joint dims move only ~2°. The mean error hides this completely.## CodeEvaluation stack, real-robot client and the staged validation tooling:`examples/g2_dualarm/` in the accompanying openpi fork.5 unmodified lines67891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141155 unmodified lines- openpi- pi0- lerobot- manipulation- bimanuallibrary_name: openpipipeline_tag: robotics---# openpi_lab — real-robot π₀ checkpoints + the datasets they were trained onTwo robots, each with its trained π₀ weights and the exact LeRobot dataset behind them.Everything here has been run on real hardware, not only in replay.```g2/model/ π₀, 30k steps g2/dataset/ 58 ep / 48,332 frames / 10 Hzpiper/model/pi0/ π₀, 30k steps piper/dataset/ 125 ep / 71,702 frames / 30 Hzpiper/model/pi05/ π₀.₅, 30k steps```| | **G2** | **Piper** ||---|---|---|| Robot | AgiBot G2, **dual** 7-DOF arm | AgileX Piper, **single** 6-DOF arm || Action / state | 16-D `[L_j1..7, L_grip, R_j1..7, R_grip]` | 7-D `[j1..j6, gripper]` || Action space | absolute joint rad + boolean gripper | joint **delta** from episode start + absolute gripper (m) || Cameras | head + hand_left + hand_right | head + hand || Control rate | **10 Hz** | **30 Hz** || Chunk | 50 | 16 || Tasks | 1 (`Make a yogurt bowl with cereal and fruit.`) | 4 (pen→cup, carrot→bowl, blocks→drawer, stack bowls) |## Download```bashhf download siyuhsu/openpi_lab --include "g2/model/*" --local-dir ./g2_ckpthf download siyuhsu/openpi_lab --include "piper/model/pi0/*" --local-dir ./piper_pi0hf download siyuhsu/openpi_lab --include "g2/dataset/*" --local-dir ./g2_data```## Serving```bash# G2python examples/g2_dualarm/g2_serve_openpi.py --config pi0_g2_dualarm \--ckpt-dir ./g2_ckpt/g2/model --port 8000# Piperpython examples/piper/code/piper_serve_openpi.py --config pi0_piper_4task \--ckpt-dir ./piper_pi0/piper/model/pi0 --port 8000```Each server publishes its deployment contract in the connect-time metadata(`action_chunk_size`, `action_rate_hz`, `robot_servo_hz`, `action_space`, `reset_pose`).> ⚠️ **Advance the action chunk at the DATASET rate, not the servo rate.** G2 is 10 Hz,> Piper is 30 Hz. Actions are absolute (G2) or delta-from-start (Piper) joint targets;> stepping G2's chunk at 30 Hz would execute it 3× too fast.## Results**G2** — offline replay against a live server, 120 frames / 12 episodes:| metric | value | threshold ||---|---|---|| joint MAE | **0.28°** (worst 0.95°) | < 5° || gripper agreement | **99.8%** | > 90% || delta direction cosine | **0.999** | > 0.8 |Validated on hardware in four stages — dry-run → ground-truth replay → policy-replay ondataset observations → live closed loop — and completes the task in the last stage.**Piper** — replay eval, all 4 tasks GO: pi0 joint MAE 0.74° / cos 0.940; pi0.5 0.44° / cos 0.995.Real-robot success rates over 160 rollouts (10 per model × task × condition):| model | in-dist | OOD-L1 | overall ||---|---|---|---|| baseline QwenOFT | 55% | 30% | 42.5% || ctxdemo QwenLAP | 80% | 75% | 77.5% || **π₀** | **85%** | **80%** | **82.5%** || π₀.₅ | 80% | 60% | 70% |## Things that will bite you* **G2 gripper polarity is inverted between dataset and wire.** In the dataset `1.0` = OPEN,`0.0` = CLOSED — the raw field is called `gripper_closed` and **the name is backwards**relative to the physical behaviour. Verified from physical semantics: in episode 27 theright gripper dim flips `1.0 → 0.0` at step 54, exactly as the arm reaches its deepestpoint (the grasp). On that robot's DDS tool wire the convention is the opposite again.Confirm your own wire convention before driving hardware.* **G2's right gripper position sensor is dead** (constant 0.2173 in all 60 episodes), soboth gripper dims come from the *command* boolean, not a sensor.* **G2 `_rs10` = resampled to a uniform 10 Hz grid.** Raw recordings are badly jittered —but the cause is the on-robot **disk writer**, not the cameras or the control loop(control runs at a steady 29.5–29.9 Hz; 60–65% of frames never reach disk). Naivecontiguous re-indexing distorts episode duration by −18%…+35%; resampling is +0.06%.* **Do not JPEG-compress observations to save bandwidth.** Measured on the G2 checkpoint,q92/q85 flips the *gripper decision* outright (|Δ| = 1.007 on a boolean dim, 3 of 6trials) while joint dims move only ~2°. Mean error hides this completely.* **These policies are stochastic** (flow matching): identical input gives joint outputsdiffering by ~1.2°. Repeated inference is not a determinism check.* Piper's `action` is the recorded teleop target and **leads the state by ~3 frames**;G2's satisfies `action[t] == state[t+1]` exactly. Do not assume one convention for both.## ScopeSingle scene per task, 58 (G2) / 125 (Piper) demonstrations. Expect brittleness outside therecorded prop layout.## Code`examples/g2_dualarm/` and `examples/piper/` in the accompanying openpi fork, including thereal-robot clients, the staged validation tooling and the hardware-verification scripts.
README.md+80-78