File size: 8,256 Bytes
4edc252 1d944f4 4edc252 9d06a74 4edc252 24658bb 4edc252 9d06a74 4edc252 9d06a74 4edc252 9d06a74 4edc252 1d944f4 4edc252 9d06a74 4edc252 9d06a74 4edc252 1d944f4 4edc252 9d06a74 4edc252 bb0fb1f 4edc252 bb0fb1f 4edc252 bb0fb1f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | ---
license: apache-2.0
library_name: mimickit
tags:
- motion-tracking
- deepmimic
- humanoid
- unitree-g1
- lafan
- ppo
- reinforcement-learning
- isaac-lab
datasets:
- lvhaidong/LAFAN1_Retargeting_Dataset
- ember-lab-berkeley/LAFAN-G1
base_model: []
pipeline_tag: reinforcement-learning
---
# MimicKit-G1-LAFAN
5 motion-tracking policies for Unitree G1 (29-DoF) trained with [MimicKit](https://github.com/xbpeng/MimicKit) DeepMimic-style PPO on LAFAN1 retargeted slices: **fight, run, dance, jumps** (15 s each), plus a longer **30 s dance** (`dance1_subject2`) that warm-starts from the 15 s dance and holds full-horizon tracking. Single 4090 24G, ~1 h per 15 s motion, 4096 envs.
**Project repo (ζΊη / ε€η°ε
₯ε£):**
- π§ͺ [vitorcen/isaaclab-experience](https://github.com/vitorcen/isaaclab-experience) β MimicKit training scripts, eval chain, USD material fix, design docs
---
## TL;DR
| Motion | Episode-Length (η»ζ / max=15s) | Ship quality | Frames slice |
|---|---|---|---|
| **fight** | 14.85 s / **99.0 %** | π’ 触鑢 | LAFAN `fight1_subject2` [600:1050] |
| **dance** | 14.70 s / **98.0 %** | π’ 触鑢 | LAFAN `dance1_subject1` [1746:2196] |
| **jumps** | 14.70 s / **98.0 %** | π’ 触鑢 | LAFAN `jumps1_subject1` [3441:3891] |
| **run** | 9.45 s / **63.0 %** | π‘ plateau | LAFAN `run1_subject2` [3341:3791] |
| **dance (30 s)** | full 30 s, `Test_Return` **244** (>15 s base 227) | π’ longer-horizon | LAFAN `dance1_subject2` [1521:2421] |
3/4 of the 15 s motions reach ship quality at iter 1500. `run` plateaus at ~63 %, likely needing ADD-style residual or curriculum sequencing β kept as a baseline. The **30 s dance** doubles the horizon (900 frames @ 30 fps): warm-started from the 15 s dance ckpt and run to 2500 iters, its converged `Test_Return` (244) actually exceeds the 15 s dance (227) β the discounted return saturates near the same ceiling regardless of clip length, so matching/exceeding it means full-horizon coverage held.
---
## Demos (eval, 4 envs, with restored per-link material)
**30 s dance (longer-horizon, `dance1_subject2`)** β DeepMimic PPO holds the full 30 s; an AMP baseline on the same clip could not keep rhythm (see notes below).
<video controls width="640" src="https://huggingface.co/wsagi/MimicKit-G1-LAFAN/resolve/main/videos/dance1s2.mp4"></video>
<video controls width="640" src="https://huggingface.co/wsagi/MimicKit-G1-LAFAN/resolve/main/videos/fight.mp4"></video>
<video controls width="640" src="https://huggingface.co/wsagi/MimicKit-G1-LAFAN/resolve/main/videos/dance.mp4"></video>
<video controls width="640" src="https://huggingface.co/wsagi/MimicKit-G1-LAFAN/resolve/main/videos/jumps.mp4"></video>
<video controls width="640" src="https://huggingface.co/wsagi/MimicKit-G1-LAFAN/resolve/main/videos/run.mp4"></video>
> Student renders use the **per-link material fix** (`assets/g1_textured.usd`) β the shipped MimicKit `g1.usd` collapses every MJCF `<geom rgba>` into a single white `DefaultMaterial`. We re-parse `g1.xml`, build one `UsdPreviewSurface` per unique color, and rebind 36 mesh prims via `UsdShade.MaterialBindingAPI`. Details in the repo's `scripts/g1_usd_recolor.py`.
---
## Dataset chain
| Layer | Source | What it provides |
|---|---|---|
| Original mocap | [ubisoft-la-forge/lafan1](https://github.com/ubisoft/ubisoft-laforge-animation-dataset) (CC-BY-NC 4.0) | Raw Ubisoft Montreal BVH |
| G1 retargeting | [lvhaidong/LAFAN1_Retargeting_Dataset](https://huggingface.co/datasets/lvhaidong/LAFAN1_Retargeting_Dataset) | Unitree-style G1/H1/H1_2 retarget (community-mirrored β original unitreerobotics repo is currently offline) |
| IsaacLab AMP repack | [ember-lab-berkeley/LAFAN-G1](https://huggingface.co/datasets/ember-lab-berkeley/LAFAN-G1) | Berkeley npz repackaging (CC-BY 4.0) |
| **MimicKit slices (this repo)** | `scripts/lafan_g1_npz_to_mimickit.py` | 30 fps β MimicKit pkl, 450-frame center slices |
Slicing rule: pick the most representative central segment of each `*1` clip (skip start/end idle), 450 frames @ 30 fps = 15 s.
---
## Files
```
MimicKit-G1-LAFAN/
βββ README.md
βββ videos/
β βββ dance1s2.mp4 (0.7 MB, 30 s dance, first 8 s)
β βββ fight.mp4 (6.9 MB)
β βββ run.mp4 (2.6 MB)
β βββ dance.mp4 (1.9 MB)
β βββ jumps.mp4 (4.7 MB)
βββ fight_15s/
β βββ model_0000001500.pt # 11 MB
β βββ env.yaml # train_lafan_fight_15s_env.yaml
β βββ motion.pkl # 450-frame LAFAN slice
βββ run_15s/ β¦
βββ dance_15s/ β¦
βββ jumps_15s/ β¦
βββ dance_30s/ # longer-horizon dance (dance1_subject2)
β βββ model.pt # 11 MB, final (2500 iters, warm-started)
β βββ env.yaml # 900-frame / 30 s slice
β βββ motion.pkl
βββ assets/
βββ g1_textured.usd # 26 MB, per-link material restored
```
---
## Training recipe (all 4 identical)
| Hyperparam | Value |
|---|---|
| Algorithm | DeepMimic PPO (MimicKit default) |
| Optimizer | SGD, lr=1e-4, momentum=0.9 |
| Num envs | 4096 (Isaac Lab, RTX 4090 24 G) |
| Iters | 1500 |
| Action std (Gaussian policy) | 0.05 |
| Reward | DeepMimic style: pose + vel + ee + root + COM, no AMP discriminator |
| Termination | head fall, knee contact, large pose error |
| Wallclock | ~1 h / motion |
See `<motion>/env.yaml` for the full Isaac Lab env spec and `data/agents/deepmimic_g1_ppo_agent.yaml` upstream for PPO config.
---
## Reproduce
```bash
git clone https://github.com/vitorcen/isaaclab-experience
cd isaaclab-experience && git submodule update --init dependencies/MimicKit
# 1. Pull LAFAN G1 retargeting npz (from ember-lab-berkeley)
huggingface-cli download ember-lab-berkeley/LAFAN-G1 --repo-type dataset \
--local-dir dependencies/MimicKit/data/motions/g1_extra/ember_lab
# 2. Convert + slice (4 Γ 450-frame center clips)
python scripts/lafan_g1_npz_to_mimickit.py # see script for slice ranges
# 3. (optional) Restore per-link material on the student USD
python scripts/g1_usd_recolor.py
export MIMICKIT_G1_USD=$PWD/dependencies/MimicKit/data/assets/g1/g1_textured.usd
# 4. Train all 4 motions sequentially (~4 h total on a 4090)
scripts/mimickit_train_queue.sh
# 5. Eval chain (sequential GUI windows)
scripts/mimickit_eval_chain.sh
```
---
## Known limitations
- **`run` plateau at 63 %**: the LAFAN run clip has fast contact + slip; vanilla DeepMimic reward + fixed action std saturates here. Likely fixes: ADD residual, motion-curriculum from walk, or larger action std at start.
- **Single-clip overfit**: each policy tracks one clip; no multi-motion conditioning. For composition, see ProtoMotions / OmniH2O.
- **AMP vs phase-tracking on dance**: an AMP (adversarial motion prior) baseline on the full 131 s `dance1_subject2` failed β the discriminator plateaued at ~0.98 agent-accuracy and the policy could not keep the choreography's rhythm. Phase-conditioned DeepMimic tracking (used here) is the right tool for high-fidelity dance; AMP fits continuous/loopable skills that don't require exact timing. The 30 s dance is the DeepMimic answer to "longer dance."
- **No sim-to-real transfer attempted**: trained in Isaac Lab with raw observations, no domain randomization, no actuator delay model.
---
## License
- Code & policy weights: Apache-2.0
- LAFAN1 motion data: CC-BY-NC 4.0 (Ubisoft Montreal) β non-commercial only
- G1 USD assets: Unitree
## Citation
Upstream papers (cite these instead β this repo is just trained weights, not a publication):
```bibtex
@inproceedings{peng2018deepmimic,
title = {DeepMimic: Example-Guided Deep Reinforcement Learning of Physics-Based Character Skills},
author = {Peng, Xue Bin and Abbeel, Pieter and Levine, Sergey and van de Panne, Michiel},
booktitle = {ACM Trans. Graph. (SIGGRAPH)},
year = {2018}
}
@article{harvey2020robust,
title = {Robust Motion In-betweening},
author = {Harvey, F{\'e}lix G. and Yurick, Mike and Nowrouzezahrai, Derek and Pal, Christopher},
journal = {ACM Trans. Graph. (SIGGRAPH)},
year = {2020}
}
```
|