motion-retargeting
Prepare SMPL and AMASS assets, fit ASAP humanoid shapes and motions, validate robot motion assets, and visualize retargeted motion in MuJoCo.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- motion-retargeting
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Prepare SMPL and AMASS assets, fit ASAP humanoid shapes and motions, validate robot motion assets, and visualize retargeted motion in MuJoCo.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/data-formats.md8.9 KB
- 参考文档references/troubleshooting.md9.1 KB
- 参考文档references/workflows.md7.2 KB
- 脚本scripts/validate_motion_assets.py23.0 KB
03 SKILL.md 正文
motion-retargeting
Use this sub-skill when an ASAP task is about turning SMPL or AMASS motion into robot motion .pkl files, checking robot XML/motion config assets, fitting a humanoid shape, retargeting motion, or visualizing retargeted motion with MuJoCo.
Run ASAP retargeting entry points from the repository checkout root. Run bundled validation helpers from the generated ASAP skill root with --repo-root <asap-checkout>. If the request is about policy training, checkpoint evaluation, or deployment/control rather than motion file preparation, route to the sibling skills instead.
When to use this sub-skill
- Prepare SMPL model files under
humanoidverse/data/smpl/. - Prepare AMASS-style
.npzmotion files for the ASAP retargeting scripts. - Check
robot.motionconfig fields, MuJoCo XML, URDF, and mesh layout for a robot such asg1/g1_29dof_anneal_23dof. - Run
fit_smpl_shape.pyto createhumanoidverse/data/shape/<humanoid_type>/shape_optimized_v1.pkl. - Run
fit_smpl_motion.pyto create per-motion joblib files underhumanoidverse/data/motions/<humanoid_type>/TairanTestbed/singles/. - Run
vis_q_mj.pywith+visualize_motion_file=...to inspect the retargeted motion in MuJoCo.
Do not use this sub-skill for
- PPO, motion-tracking, locomotion, or delta-action policy training. Use
../training-and-evaluation/SKILL.md. - ROS2, Unitree SDK, joystick, ONNX policy runtime, or live robot deployment. Use
../sim2real-deployment/SKILL.md. - Generic SMPL or AMASS conversion outside the ASAP/HumanoidVerse file layout unless the user explicitly wants to adapt files into ASAP's expected layout.
Required reading order
- Read the root ASAP router and install guidance first:
../../SKILL.mdand../../references/install-and-backends.md. - Read
references/workflows.mdfor the five-step retargeting flow and exact commands. - Read
references/data-formats.mdbefore changing file names, joblib keys, or robot config values. - Run the bundled safe checker before expensive fitting:
python sub-skills/motion-retargeting/scripts/validate_motion_assets.py \
--repo-root <asap-checkout> \
--robot g1/g1_29dof_anneal_23dof \
--check-raw
- If an error occurs, read
references/troubleshooting.md, then the root troubleshooting page../../references/troubleshooting.mdfor shared install, Hydra, and backend issues.
Fast command map
Preflight current G1 assets and a known retargeted motion file:
python sub-skills/motion-retargeting/scripts/validate_motion_assets.py \
--repo-root <asap-checkout> \
--robot g1/g1_29dof_anneal_23dof \
--motion-file humanoidverse/data/motions/g1_29dof_anneal_23dof/TairanTestbed/singles/0-motions_raw_tairantestbed_smpl_video_side_jump_level4_filter_amass.pkl \
--check-raw
Fit robot shape after SMPL files are present:
python scripts/data_process/fit_smpl_shape.py +robot=g1/g1_29dof_anneal_23dof
Fit motions after the shape file and raw .npz motion files are present:
python scripts/data_process/fit_smpl_motion.py +robot=g1/g1_29dof_anneal_23dof
Visualize one retargeted output:
python scripts/vis/vis_q_mj.py \
+robot=g1/g1_29dof_anneal_23dof \
+visualize_motion_file="humanoidverse/data/motions/g1_29dof_anneal_23dof/TairanTestbed/singles/0-motions_raw_tairantestbed_smpl_video_side_jump_level4_filter_amass.pkl"
Dependency and asset gates
- The fitting scripts require the normal ASAP Python dependencies plus external
smpl_sim. ASAP's package metadata includeshydra-core,lxml,joblib,numpy-stl,open3d, and other scientific dependencies, butsmpl_simis a separate required dependency for shape and motion fitting. fit_smpl_shape.pyandfit_smpl_motion.pyimportsmpl_sim.smpllib.smpl_parser,smpl_sim.smpllib.smpl_joint_names, and, for motion fitting,smpl_sim.utils.smoothing_utils.- The bundled checker intentionally avoids importing ASAP or
smpl_sim; it validates file layout and joblib structure without running optimization.
Expected outputs
- Shape fit output:
humanoidverse/data/shape/g1_29dof_anneal_23dof/shape_optimized_v1.pkl. - Retargeted single-motion outputs:
humanoidverse/data/motions/g1_29dof_anneal_23dof/TairanTestbed/singles/<motion-key>.pkl. - A retargeted
.pklis a joblib-loaded dictionary. For directory-mode consumers, each file's top-level key should match the file stem. Seereferences/data-formats.md.
Cross-links
- Root ASAP skill:
../../SKILL.md. - Root install and backend notes:
../../references/install-and-backends.md. - Root troubleshooting:
../../references/troubleshooting.md. - Training and evaluation:
../training-and-evaluation/SKILL.mdfor consuming generated motion files in policy training. - Sim2real deployment:
../sim2real-deployment/SKILL.mdfor MuJoCo/ROS2/Unitree runtime control after a policy exists.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).