Skip to main content

No project description provided

Project description

eden-soma-retargeter

Note: This is an unofficial fork of NVIDIA/soma-retargeter. It is not affiliated with or endorsed by NVIDIA.

License

SOMA Retargeter Banner

Convert SOMA human motion captures into humanoid robot joint animation. Takes BVH motion files as input and produces robot-playable CSV joint data as output using GPU-optimized inverse kinematics via Newton and high-performance computation with NVIDIA Warp.

The retargeting pipeline handles proportional human-to-robot scaling, multi-objective IK solving with joint limits, feet stabilization to maintain ground contact, and per-DOF joint limit clamping. Currently supports SOMA as the input skeleton, with Unitree G1 (29 DOF) and LimX Oli (HU_D04, 31 DOF) as output robots. Robots are defined by a soma_retargeter/configs/<robot>/ config bundle — adding one requires no dispatch-code changes (see the robot_model config section and soma_retargeter.pipelines.robot_model).

Note: This project is in active development. The API may change between releases as the design is refined.

Requirements

  • Python: 3.10, 3.11, or 3.12 (upstream tested on 3.12; 3.10/3.11 supported via relaxed numpy/scipy pins)
  • Git LFS: Installed and initialized for asset downloads (only needed when working from source)
  • OS: Windows (x86-64) and Linux (x86-64, aarch64)
  • GPU: NVIDIA GPU (Maxwell or newer), driver 545+ (CUDA 12). No local CUDA Toolkit installation required.

Installation

From PyPI (recommended)

pip install eden-soma-retargeter
soma-bvh-to-csv --help

This installs the soma_retargeter Python package and the soma-bvh-to-csv console script. The default retargeting config and the SOMA zero-frame BVH ship inside the wheel, so no LFS checkout is needed for the standard pipeline.

Runtime requirements: Python 3.10/3.11/3.12, NVIDIA GPU (Maxwell or newer), driver 545+.

From source (for contributors)

LFS only needs to be pulled if you plan to use the sample motions in assets/motions/ or rebuild the docs in assets/docs/. The wheel itself bundles only the default config and the SOMA zero-frame BVH that already live under soma_retargeter/configs/.

Method 1 (conda + pip)

conda create -n soma-retargeter python=3.12 -y
conda activate soma-retargeter
git lfs pull   # sample motions / docs assets
pip install .

Method 2 (uv)

Install uv, then:

git lfs pull
uv sync

uv sync creates an isolated .venv inside the project directory, installs the correct Python version and resolves all dependencies.

Platform-specific notes

Note (Linux): For the GUI viewer to work, install tkinter

sudo apt-get install python3.12-tk

Note (Windows): If imgui-bundle fails to install, the Microsoft Visual C++ Redistributables may be missing. Download from the official Microsoft documentation.

Motion Data

This repo includes 10 sample BVH/CSV pairs in assets/motions/ for immediate testing.

For large-scale motion data, see the SEED dataset (Skeletal Everyday Embodiment Dataset) published by Bones Studio. SEED provides a large-scale collection of human motions on the SOMA uniform-proportion skeleton, which is the expected input format for this tool. The G1 robot motion data included in SEED was retargeted using the upstream SOMA Retargeter.

Quick Start

When using uv, replace soma-bvh-to-csv with uv run soma-bvh-to-csv in the commands below.

Interactive viewer (OpenGL)

soma-bvh-to-csv --viewer gl

This uses the bundled default config. To override:

soma-bvh-to-csv --config ./my_config.json --viewer gl

Interactive viewer interface

The viewer displays the source SOMA motion alongside the retargeted robot in a 3D viewport. Use the right panel to load BVH files, run retargeting, and save CSV output. Playback controls at the bottom allow scrubbing, speed adjustment, and looping. Toggle visibility of the skinned mesh, skeleton, joint axes, and positioning gizmos.

Batch conversion (headless)

Process a folder of BVH files without a display. Set import_folder and export_folder in the config file, then run:

soma-bvh-to-csv --config ./my_config.json --viewer null

Batch mode recursively finds all .bvh files in the import folder, processes them in configurable batch sizes, and writes CSV files to the export folder mirroring the input directory structure.

The same entry point is also reachable as a Python module, useful for embedding in other tools:

python -m soma_retargeter.app.bvh_to_csv_converter --viewer null

In-process Python API (soma_retargeter.retargeting)

For embedding retargeting directly in a Python program — with no temp files or subprocesses, and flat memory across an unbounded stream of clips — use MotionRetargeter. It also fits SMPL / SMPL-H / SMPL-X motion into the SOMA rig on the way in (via py-soma-x), so you can retarget raw AMASS-style body-model motion, not just SOMA BVH.

from soma_retargeter.retargeting import MotionRetargeter

# SMPL-X -> Unitree G1 (fitting requires the [fit] extra)
rt = MotionRetargeter(body_model="smplx", body_model_path="/path/to/SMPLX_NEUTRAL.npz",
                      target_fps=30.0, device="cuda")
out = rt.retarget(poses, trans, source_fps=120.0, betas=betas)   # AMASS layout arrays
# out = {"root_pos" (T,3) m, "root_quat" (T,4) wxyz, "dof_pos" (T,29) rad,
#        "joint_names" [29], "fps"}

# Native SOMA motion needs no body model and no torch:
rt_soma = MotionRetargeter(body_model="soma", target_fps=30.0)
out = rt_soma.retarget_bvh("motion.bvh")                 # SOMA-skeleton BVH (e.g. BONES-SEED)
out = rt_soma.retarget_soma_npz("motion.npz", source_fps=30.0)   # save_soma_npz format

# SOMA -> LimX Oli (31 DOF). The Oli URDF is not bundled: pass your own copy
# (e.g. HU_D04_01.urdf from the robot's asset distribution).
rt_oli = MotionRetargeter(body_model="soma", robot="limx_oli",
                          robot_model_path="/path/to/HU_D04_01.urdf")
out = rt_oli.retarget_bvh("motion.bvh")                  # dof_pos (T, 31)

Install the fit dependencies with the extra:

pip install "eden-soma-retargeter[fit]"

retarget_batch([...]) retargets many clips in one IK solve (one env per clip). See the MotionRetargeter docstring for the full option set (per-call gender, chunk sizes, IK overrides, …).

Code Overview

soma_retargeter/

Module Description
app/bvh_to_csv_converter.py Main entry point (also exposed as the soma-bvh-to-csv console script). Drives both interactive and headless batch retargeting modes.
animation/ Core data structures for skeletons, animation buffers, IK, and skinned meshes.
assets/ File I/O for BVH, CSV, and USD formats.
pipelines/ Retargeting pipeline: IK solving, feet stabilization, and joint limit clamping.
retargeting/ Fork-added in-process Python API (MotionRetargeter): SMPL-family fitting + native SOMA input.
robotics/ Human-to-robot scaling and robot output formatting.
renderers/ Visualization for the interactive viewer.
utils/ Math, pose, coordinate conversion, Newton and Warp helpers.
configs/ JSON configuration for retargeting, scaling, and feet stabilization parameters, plus the default default_bvh_to_csv_converter_config.json shipped with the wheel.

Related Work & Acknowledgments

Upstream SOMA-ecosystem projects for humanoid motion data:

  • SOMA Body Model - Parametric human body model with standardized skeleton, mesh, and shape parameters
  • GEM-X - Human motion estimation from video
  • Kimodo - Kinematic motion diffusion model for text and constraint-driven 3D human and robot motion generation
  • ProtoMotions - GPU-accelerated simulation and learning framework for training physically simulated digital humans and humanoid robots
  • SONIC - Whole-body control for humanoid robots, training locomotion and interaction policies

The upstream project also draws on GMR (General Motion Retargeting) and PyRoki (A Modular Toolkit for Robot Kinematic Optimization).

License

Licensed under Apache-2.0, same as the upstream project. Installation pulls in third-party open-source dependencies; review their license terms before use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eden_soma_retargeter-0.3.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eden_soma_retargeter-0.3.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file eden_soma_retargeter-0.3.0.tar.gz.

File metadata

  • Download URL: eden_soma_retargeter-0.3.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eden_soma_retargeter-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0da7ebeb40488a633ea4b1a8461e46bf90e3ec7ee9016839dfd21df446e7f8a6
MD5 4931e9bbd3c4fd9f4fbddf994637e67c
BLAKE2b-256 937527f536e3724239f5f0edc125f5ca1a89adc0d478e5453be14a040d40f37e

See more details on using hashes here.

Provenance

The following attestation bundles were made for eden_soma_retargeter-0.3.0.tar.gz:

Publisher: release.yml on lalit-jayanti/eden-soma-retargeter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eden_soma_retargeter-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eden_soma_retargeter-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b12580ff2ef3ab023418dc875e4734cc32134e7390c16bedcb60beaf0ed90b56
MD5 2e54be60a222e014f139b4979c940500
BLAKE2b-256 f0a6af0a299facdbb92b671c6c1af0d0de3088fb3bea430d7fe32b3b3bcee65b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eden_soma_retargeter-0.3.0-py3-none-any.whl:

Publisher: release.yml on lalit-jayanti/eden-soma-retargeter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page