Open-sourced ONNX neural network policy files for humanoid robots
This repository provides pre-trained reinforcement learning controllers exported in ONNX format for direct deployment on humanoid robots. Policies cover locomotion, whole-body motion tracking, and combat/sports motions.
| Robot | Manufacturer | DOF |
|---|---|---|
| G1 | Unitree Robotics | 29 |
| X2 | Agibot | 29 |
onnx_policy/
├── unitree/
│ └── g1/
│ ├── unitree_locomotion/ # Locomotion policy with metadata
│ ├── whole_body_tracking/ # Motion tracking (dancing, idle, kicks, ...)
│ ├── boxing/ # Boxing and MMA strike motions
│ ├── legged_lab/ # AMP-based locomotion
│ └── holosoma_locomotion/ # Holosoma fastsac locomotion variants
└── agibot/
└── x2/
├── whole_body_tracking/ # Motion tracking (dancing, idle, look around, ...)
├── boxing/ # Boxing and MMA strike motions
└── holosoma_locomotion/ # Holosoma locomotion
- Git LFS — all
.onnxfiles are stored via Git LFS. - ONNX Runtime — to run inference with the policies.
git lfs install
git clone https://github.com/IO-AI-TECH/onnx_policy.gitEach policy is a standard ONNX model. Load it with ONNX Runtime:
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("unitree/g1/unitree_locomotion/g1_policy.onnx")
input_name = session.get_inputs()[0].name
obs = np.zeros((1, 47), dtype=np.float32) # num_observations = 47
action = session.run(None, {input_name: obs})[0]Refer to the accompanying *_metadata.json for the correct observation dimension, joint order, PD gains, and scaling factors for each policy.
For policies that include a metadata file, the fields are:
| Field | Description |
|---|---|
num_observations |
Observation vector dimension |
num_actions |
Number of controlled joints |
action_scale |
Scalar multiplier applied to policy output |
joint_names |
Ordered joint names matching action indices |
default_joint_pos |
Nominal joint positions (radians) |
kp / kd |
PD stiffness and damping gains per joint |
observation_names |
Ordered observation components |
*_scale |
Scaling factors for each observation component |
is_recurrent |
Whether the policy uses an LSTM |
rnn_type / rnn_hidden_size / rnn_num_layers |
RNN architecture (if recurrent) |
This project is licensed under the MIT License.