Metadata-Version: 2.4
Name: imitationlab
Version: 0.1.1
Summary: Whole-body motion tracking for the Unitree G1 in Isaac Lab
Author: Feiyang Wu
License-Expression: MIT
Project-URL: Homepage, https://github.com/GTLIDAR/ImitationLab
Project-URL: Repository, https://github.com/GTLIDAR/ImitationLab
Project-URL: Issues, https://github.com/GTLIDAR/ImitationLab/issues
Project-URL: Documentation, https://github.com/GTLIDAR/ImitationLab/tree/main/docs
Project-URL: Paper, https://arxiv.org/abs/2609.37677
Keywords: imitation learning,motion tracking,humanoid,isaac lab,reinforcement learning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
License-File: third_party/licenses/isaaclab.txt
License-File: third_party/licenses/ndm_gym.txt
License-File: third_party/licenses/supermimic_vibed.txt
Requires-Dist: diffusers
Requires-Dist: gymnasium>=1.1
Requires-Dist: numpy
Requires-Dist: omegaconf>=2.3
Requires-Dist: pydantic>=2
Requires-Dist: psutil
Requires-Dist: scipy
Requires-Dist: pyyaml
Requires-Dist: rich
Requires-Dist: tensordict>=0.11
Requires-Dist: torch>=2.7
Requires-Dist: torchrl>=0.11
Requires-Dist: tqdm
Requires-Dist: wandb
Requires-Dist: zarr>3
Provides-Extra: hub
Requires-Dist: huggingface_hub; extra == "hub"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.10; extra == "viz"
Requires-Dist: mujoco; extra == "viz"
Dynamic: license-file

<div align="center">

# ImitationLab

**Train whole-body motion trackers for the Unitree G1 in minutes on one GPU.**

[![Checks](https://github.com/GTLIDAR/ImitationLab/actions/workflows/checks.yml/badge.svg)](https://github.com/GTLIDAR/ImitationLab/actions/workflows/checks.yml)
[![arXiv](https://img.shields.io/badge/arXiv-2609.37677-b31b1b.svg)](https://arxiv.org/abs/2609.37677)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/LICENSE)
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/pixi.toml)
[![Isaac Lab](https://img.shields.io/badge/simulator-Isaac%20Lab%20%C2%B7%20Newton%2FMJWarp-76b900.svg)](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/setup.md)

[Quick start](https://github.com/GTLIDAR/ImitationLab#quick-start) ·
[Results](https://github.com/GTLIDAR/ImitationLab#results) ·
[Documentation](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/README.md) ·
[Motion data](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/data/README.md) ·
[Contributing](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/CONTRIBUTING.md)

</div>

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/GTLIDAR/ImitationLab/v0.1.1/docs/benchmarks/g1-release-check/overview-dark.svg">
  <img alt="Tracking success and local pose error versus policy training time for SuperMimic, SVG, DiffSR and PPO: median and range over six G1 runs" src="https://raw.githubusercontent.com/GTLIDAR/ImitationLab/v0.1.1/docs/benchmarks/g1-release-check/overview-light.svg">
</picture>

ImitationLab is a research codebase for humanoid motion tracking in
[Isaac Lab](https://github.com/isaac-sim/IsaacLab) with the Newton/MJWarp
physics backend. One task, four policy learners, and three ways to feed the
reference motion to the policy share a single command-line tool, so learners
and interfaces can be compared on equal terms.

## Highlights

- **Fast.** SuperMimic reaches at least 90% tracking success with at most
  40 mm local pose error after about 10 minutes of training on one H100, on
  both LAFAN1 and the 129,785-clip BONES-SEED bank.
- **Four learners, one task.** SuperMimic-style BPTT, SVG, DiffSR dynamics
  and PPO train on the same `imitation-g1-v1` observation, action and reward
  contract.
- **Explicit or latent commands.** Feed the policy future reference frames
  directly, or a frozen skill encoder's latent. Latent policies read only the
  reference motion, so they need an IMU but no position estimate on the robot.
- **Sizes itself to the GPU.** The same command trains on a 16 GB RTX 4080
  and on an H200; execution sizes are chosen from the GPU, host memory and
  motion bank.
- **Reproducible.** Locked Pixi environments, versioned recipes, and
  checkpoints that record their task, learner, interface, data identity,
  encoder weights and seed.

## Quick start

**Requirements:** Linux x86-64, an NVIDIA GPU, and
[Pixi](https://pixi.sh) 0.83 or newer. Run commands from the repository root.

```bash
git clone https://github.com/GTLIDAR/ImitationLab.git
cd ImitationLab
pixi install --locked -e isaaclab
```

No motion data is distributed with the repository. Download the public LAFAN1
retargeting, convert it, and pack it into a reference bank
([motion data](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/data/README.md) explains each step):

```bash
pixi run -e isaaclab imitationlab data prepare lafan1 \
  --data-root data/lafan1 --batch-size 64

MANIFEST=data/lafan1/manifests/g1_lafan1_manifest.json
PERSIST_ID="g1@$(sha256sum "$MANIFEST" | cut -c1-12)"
BANK="data/reference_arrays/${PERSIST_ID}"
pixi run -e isaaclab imitationlab data pack "$MANIFEST" \
  --output-dir "$BANK" --persist-id "$PERSIST_ID" \
  --anchor-body pelvis --workers 4 --verify-load \
  --body-names pelvis left_hip_roll_link left_knee_link left_ankle_roll_link \
    right_hip_roll_link right_knee_link right_ankle_roll_link torso_link \
    left_shoulder_roll_link left_elbow_link left_wrist_yaw_link \
    right_shoulder_roll_link right_elbow_link right_wrist_yaw_link
```

Check the installation with a smoke test, which runs one PPO iteration on the
bank:

```bash
BANK="$BANK" pixi run -e isaaclab smoke-g1
```

Starting Isaac Sim, for conversion or training, requires accepting the NVIDIA
Omniverse license; see [setup](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/setup.md).

Then train and evaluate a tracker:

```bash
RUN=outputs/quickstart/supermimic
pixi run -e isaaclab imitationlab train \
  --policy supermimic --interface explicit --data "$BANK" \
  "agent.logger.log_dir=$RUN"

pixi run -e isaaclab imitationlab evaluate --checkpoint "$RUN" --data "$BANK" \
  --num-envs 4 --trajectory-ranks 0 1 2 3
```

`evaluate` writes `outputs/evaluation/result.json`; pass `--overwrite` or a
new `--output` when re-running.

Explicit overrides take precedence over automatic sizing, and a resumed run
keeps its saved sizes. [Training and evaluation](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/training.md) covers
encoder pretraining, checkpoints, export and benchmarks.

## Pretrained checkpoints

The Hugging Face release location for G1 policy checkpoints and their encoders is
[GeorgiaTech/ImitationLab-G1](https://huggingface.co/GeorgiaTech/ImitationLab-G1).

## Learners and interfaces

The policy learner and the command interface are independent choices.

| `--policy` | Learner |
| --- | --- |
| `supermimic` (default) | BPTT through imagined world-model rollouts |
| `svg` | Pathwise gradients along recorded simulator windows |
| `diffsr` | BPTT through a DiffSR spectral dynamics model of the low-level state |
| `ppo` | Clipped policy updates from simulator rollouts |

| `--interface` | Tracker input |
| --- | --- |
| `explicit` (default) | Ten future reference frames |
| `fsq` | A frozen spectral skill encoder with a finite-scalar-quantized (FSQ) latent |
| `spectral` | A frozen spectral skill encoder with a continuous latent |

Both latent interfaces pretrain the same spectral skill objective: a bilinear
spectral energy ties the skill latent to the motion transition, and a
predictor keeps it predictable one chunk ahead. They differ only in whether
the latent is quantized.

## Commands

| Command | Purpose |
| --- | --- |
| `imitationlab data` | Prepare, validate, and pack LAFAN1 and BONES-SEED motions |
| `imitationlab pretrain` | Pretrain an FSQ or spectral skill command encoder |
| `imitationlab train` | Train a tracker; `--dry-run` prints the resolved command |
| `imitationlab evaluate` | Evaluate a checkpoint with its saved task and network settings |
| `imitationlab export` | Export a checkpoint and its encoder as a native bundle |
| `imitationlab hardware` / `tune` | Show or measure execution sizes for this machine |
| `imitationlab benchmark` | Measure tracking quality against training time |

Run `imitationlab <command> --help` for the options of a command.

## Results

30-minute runs on one NVIDIA H100 80 GB, seed 42, with the current defaults.
Each case trains on its motion bank and is evaluated on that whole bank: all 40
LAFAN1 clips or all 129,785 BONES-SEED clips, each for up to 10 seconds. The
ranges cover both banks and all three interfaces; the figure at the top shows
the same runs over time.

| Learner | Final success | Final MPJPE-L | First ≥90% success with MPJPE-L ≤40 mm |
| --- | ---: | ---: | --- |
| SuperMimic (BPTT) | 99.7–100% | 13.1–17.3 mm | About 10 minutes in all six cases |
| SVG | 97.7–100% | 14.9–23.6 mm | 10–15 minutes |
| DiffSR dynamics | 97.5–99.7% | 16.3–25.4 mm | 10–15 minutes |
| PPO | 87.5–93.9% | 48.2–64.6 mm | Not reached in 30 minutes |

In the figure, lines are medians over the six cases (two motion banks × three
interfaces) and bands span their range. Encoder pretraining and startup add
2.8–12.5 minutes.

**Scope of these numbers.** They are single-seed measurements on training
motions in simulation. They measure how fast each learner acquires tracking,
not held-out generalization, and the policies have not been validated on
hardware.

**Other GPUs.** The same 24 cases were run on four GPUs, from a 16 GB RTX 4080
to an H200. SuperMimic reaches 99.4–99.9% success on the full BONES-SEED bank
on every tier. See the
[four-tier release check](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/benchmarks/g1-release-check.md).

**Further reports.**

- [PPO tuning](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/benchmarks/ppo-tuning.md): three stronger PPO recipes did
  not improve tracking reliably, so the PPO default is unchanged.
- [SVG tuning](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/benchmarks/svg-tuning.md): no SVG recipe improved tracking
  over BPTT in both seeds in any of the six cases.
- [Earlier 30-minute H100 report](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/benchmarks/g1-learning-speed-30min/README.md):
  per-case survival, threshold times and costs. Its latent policies used the
  first-release encoder window, which also reads the robot's position.

## Motion data

| Dataset | Clips | Access |
| --- | ---: | --- |
| [LAFAN1, retargeted to G1](https://huggingface.co/datasets/lvhaidong/LAFAN1_Retargeting_Dataset) | 40 | Public download |
| [BONES-SEED](https://huggingface.co/datasets/bones-studio/seed) | 129,785 | Gated; separately licensed by Bones Studio |

No motion data is distributed with this repository. `imitationlab data`
downloads or converts each dataset into a packed reference bank; see
[motion data](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/data/README.md). Review the BONES-SEED license before sharing
weights or other results trained on it.

## Documentation

| Guide | Contents |
| --- | --- |
| [Setup](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/setup.md) | Pixi environments, Isaac Lab, and the optional official SuperMimic runner |
| [Motion data](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/data/README.md) | LAFAN1 and BONES-SEED preparation and packed reference banks |
| [Training and evaluation](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/training.md) | Commands, learners, interfaces, checkpoints, export, and benchmarks |
| [Hardware selection](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/hardware.md) | Automatic execution sizes and local throughput tuning |
| [Architecture](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/architecture.md) | Package boundaries and module ownership |

The [documentation index](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/README.md) lists every guide and report.

## Repository layout

| Path | Contents |
| --- | --- |
| [imitationlab/algorithms](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/algorithms) | Policy learners and shared learner components |
| [imitationlab/encoders](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/encoders) | Spectral skill command encoders (FSQ and continuous) |
| [imitationlab/envs/isaaclab](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/envs/isaaclab) | The G1 task, simulator adapters, task math, and robot assets |
| [imitationlab/data_tools](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/data_tools) | Dataset conversion, validation, and packed reference banks |
| [imitationlab/runners](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/runners) | Launch, training, hardware sizing, benchmarks, and cluster submission |
| [imitationlab/evaluation](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/imitationlab/evaluation) | Checkpoint rollouts, metrics, and export |
| [experiments/recipes](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/experiments/recipes) | Versioned training and encoder settings |
| [third_party/supermimic](https://github.com/GTLIDAR/ImitationLab/tree/v0.1.1/third_party/supermimic) | Official SuperMimic baseline with its own environment |

## Contributing

Contributions are welcome. Branch from `main`, run the CPU tests and static
checks, and open a pull request:

```bash
pixi install --locked
pixi run test-default
pixi run -e static ci-static
```

[CONTRIBUTING.md](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/CONTRIBUTING.md) describes the workflow, where code belongs,
and what to record when reporting results. Please use
[GitHub issues](https://github.com/GTLIDAR/ImitationLab/issues) for bugs and
questions.

## Citation

If you use ImitationLab or its spectral skill encoders in your research,
please cite:

```bibtex
@article{wu2026spectral,
  title   = {Learning Expressive and Compositional Motion Representation via Spectral Skills},
  author  = {Wu, Feiyang and Gao, Chenxiao and Yang, Chen and Zhao, Ye and Dai, Bo and Wu, Anqi},
  journal = {arXiv preprint arXiv:2609.37677},
  year    = {2026},
  url     = {https://arxiv.org/abs/2609.37677}
}
```

## Acknowledgments

ImitationLab builds on [Isaac Lab](https://github.com/isaac-sim/IsaacLab) and
Newton/MJWarp, includes the official
[SuperMimic](https://github.com/HybridRobotics/supermimic) baseline, and
adapts components credited in
[THIRD_PARTY_NOTICES.md](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/THIRD_PARTY_NOTICES.md). Pinned upstream revisions
are listed in [upstream revisions](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/docs/provenance.md). Motion data comes from the Unitree
retargeting of LAFAN1 and from Bones Studio's BONES-SEED.

## License

ImitationLab is released under the [MIT License](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/LICENSE). Upstream components
and assets keep their own licenses; see
[THIRD_PARTY_NOTICES.md](https://github.com/GTLIDAR/ImitationLab/blob/v0.1.1/THIRD_PARTY_NOTICES.md). Motion datasets are licensed
separately by their owners.
