{"id":46995501,"url":"https://github.com/unitreerobotics/unitree_lerobot","last_synced_at":"2026-03-25T18:00:49.922Z","repository":{"id":258890634,"uuid":"874533115","full_name":"unitreerobotics/unitree_lerobot","owner":"unitreerobotics","description":"The unitree_il_lerobot open-source project is a modification of the LeRobot open-source training framework, enabling the training and testing of data collected using the dual-arm dexterous hands of Unitree's G1 robot. ","archived":false,"fork":false,"pushed_at":"2026-03-04T08:36:20.000Z","size":47682,"stargazers_count":558,"open_issues_count":10,"forks_count":82,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-03-04T14:45:26.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unitreerobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-18T02:14:00.000Z","updated_at":"2026-03-04T08:36:24.000Z","dependencies_parsed_at":"2025-08-01T09:09:57.760Z","dependency_job_id":"cc6faae3-bc3a-415e-b089-f18db2c85adc","html_url":"https://github.com/unitreerobotics/unitree_lerobot","commit_stats":null,"previous_names":["unitreerobotics/unitree_il_lerobot","unitreerobotics/unitree_lerobot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/unitreerobotics/unitree_lerobot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitreerobotics%2Funitree_lerobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitreerobotics%2Funitree_lerobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitreerobotics%2Funitree_lerobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitreerobotics%2Funitree_lerobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unitreerobotics","download_url":"https://codeload.github.com/unitreerobotics/unitree_lerobot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unitreerobotics%2Funitree_lerobot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30932942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-25T17:54:13.764Z","status":"ssl_error","status_checked_at":"2026-03-25T17:54:02.372Z","response_time":80,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T15:00:24.648Z","updated_at":"2026-03-25T18:00:49.909Z","avatar_url":"https://github.com/unitreerobotics.png","language":"Python","funding_links":[],"categories":["4. 机器学习项目 | ML"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003e unitree_lerobot \u003c/h1\u003e\n  \u003ch3 align=\"center\"\u003e Unitree Robotics \u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"./README.md\"\u003e English \u003c/a\u003e | \u003ca href=\"./docs/README_zh.md\"\u003e中文\u003c/a\u003e\n  \u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n     \u003ca href=\"https://discord.gg/ZwcVwxv5rq\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Discord-5865F2?style=flat\u0026logo=Discord\u0026logoColor=white\" alt=\"Unitree LOGO\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n| Unitree Robotics repositories                      | link                                                                               |\n| -------------------------------------------------- | ---------------------------------------------------------------------------------- |\n| Unitree Datasets                                   | [unitree datasets](https://huggingface.co/unitreerobotics)                         |\n| AVP Teleoperate                                    | [avp_teleoperate](https://github.com/unitreerobotics/avp_teleoperate)              |\n| Unitree Sim IsaacLab                               | [unitree_sim_isaaclab](https://github.com/unitreerobotics/unitree_sim_isaaclab)    |\n| Conversion of various versions of lerobot datasets | [any4lerobot](https://github.com/Tavish9/any4lerobot/tree/main/ds_version_convert) |\n\n# 🔖 Release Note\n\n### 🏷️ v0.3\n\n1.Update [`lerobot dataset v3.0`](https://github.com/huggingface/lerobot/blob/main/docs/source/porting_datasets_v3.mdx).\n\n2.More policy support([`pi05`](https://github.com/huggingface/lerobot/tree/main/src/lerobot/policies/pi05), [`groot`](https://github.com/huggingface/lerobot/tree/main/src/lerobot/policies/groot)).\n\n### 🏷️ v0.2\n\n1.Add `data conversion` and `model deployment` for `brainco` and `inspire1` Dexterous hands.\n\n2.Add the functionality of `replaying the robot dataset`.\n\n3.Add `simulation environment verification` [unitree_sim_isaaclab].\n\n### 🏷️ v0.1\n\nSupport `data conversion`, `model deployment`, and `real-world testing` for `G1 + Dex1 + Dex3`.\n\n# 0. 📖 Introduction\n\nThis repository is used for `lerobot training validation`(Supports LeRobot datasets version 2.0 and above.) and `unitree data conversion`.\n\n`❗Tips： If you have any questions, ideas or suggestions that you want to realize, please feel free to raise them at any time. We will do our best to solve and implement them.`\n\n| Directory  | Description                                                                                              |\n| ---------- | -------------------------------------------------------------------------------------------------------- |\n| lerobot    | The code in the `lerobot repository` for training; its corresponding commit version number is `0878c68`. |\n| utils      | `unitree data processing tool `                                                                          |\n| eval_robot | `unitree real machine inference verification of the model`                                               |\n\n# 1. 📦 Environment Setup\n\n## 1.1 🦾 LeRobot Environment Setup\n\nThe purpose of this project is to use the [LeRobot](https://github.com/huggingface/lerobot) open-source framework to train and test data collected from Unitree robots. Therefore, it is necessary to install the LeRobot-related dependencies first. The installation steps are as follows, and you can also refer to the official [LeRobot](https://github.com/huggingface/lerobot) installation guide:\n\n```bash\n# Clone the source code\ngit clone --recurse-submodules https://github.com/unitreerobotics/unitree_lerobot.git\n\n# If already downloaded:\ngit submodule update --init --recursive\n\n# Create a conda environment\nconda create -y -n unitree_lerobot python=3.10\nconda activate unitree_lerobot\nconda install pinocchio -c conda-forge\n\nconda install ffmpeg=7.1.1 -c conda-forge\n\n# Install LeRobot\ncd unitree_lerobot/lerobot \u0026\u0026 pip install -e .\n\n# Install unitree_lerobot\ncd ../../ \u0026\u0026 pip install -e .\n```\n\n## 1.2 🕹️ unitree_sdk2_python\n\nFor `DDS communication` on Unitree robots, some dependencies need to be installed. Follow the installation steps below:\n\n```bash\ngit clone https://github.com/unitreerobotics/unitree_sdk2_python.git\ncd unitree_sdk2_python  \u0026\u0026 pip install -e .\n```\n\n# 2. ⚙️ Data Collection and Conversion\n\n## 2.1 🖼️ Load Datasets\n\nIf you want to directly load the dataset we have already recorded,\nLoad the [`unitreerobotics/G1_Dex3_ToastedBread_Dataset`](https://huggingface.co/datasets/unitreerobotics/G1_Dex3_ToastedBread_Dataset) dataset from Hugging Face. The default download location is `~/.cache/huggingface/lerobot/unitreerobotics`. If you want to load data from a local source, please change the `root` parameter.\n\n```python\nfrom lerobot.datasets.lerobot_dataset import LeRobotDataset\nimport tqdm\n\nepisode_index = 1\ndataset = LeRobotDataset(repo_id=\"unitreerobotics/G1_Dex3_ToastedBread_Dataset\")\n\nfrom_idx = dataset.meta.episodes[\"dataset_from_index\"][episode_index]\nto_idx = dataset.meta.episodes[\"dataset_to_index\"][episode_index]\n\nfor step_idx in tqdm.tqdm(range(from_idx, to_idx)):\n    step = dataset[step_idx]\n```\n\n`visualization`\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_dataset_viz.py \\\n    --repo-id unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --episode-index 0\n```\n\n## 2.2 🔨 Data Collection\n\nIf you want to record your own dataset. The open-source teleoperation project [avp_teleoperate](https://github.com/unitreerobotics/avp_teleoperate/tree/g1) can be used to collect data using the Unitree G1 humanoid robot. For more details, please refer to the [avp_teleoperate](https://github.com/unitreerobotics/avp_teleoperate/tree/g1) project.\n\n## 2.3 🛠️ Data Conversion\n\nThe data collected using [avp_teleoperate](https://github.com/unitreerobotics/avp_teleoperate/tree/g1) is stored in JSON format. Assuming the collected data is stored in the `$HOME/datasets/task_name`, the format is as follows\n\n```\ndatasets/                               # Dataset folder\n    └── task_name /                     # Task name\n        ├── episode_0001                # First trajectory\n        │    ├──audios/                 # Audio information\n        │    ├──colors/                 # Image information\n        │    ├──depths/                 # Depth image information\n        │    └──data.json               # State and action information\n        ├── episode_0002\n        ├── episode_...\n        ├── episode_xxx\n```\n\n### 2.3.1 🔀 Sort and Rename\n\nWhen generating datasets for LeRobot, it is recommended to ensure that the data naming convention, starting from `episode_0`, is sequential and continuous. You can use the following script to `sort and rename` the data accordingly.\n\n```bash\npython unitree_lerobot/utils/sort_and_rename_folders.py \\\n        --data_dir $HOME/datasets/task_name\n```\n\n#### 2.3.2 🔄 Conversion\n\nConvert `Unitree JSON` Dataset to `LeRobot` Format. You can define your own `robot_type` based on [ROBOT_CONFIGS](https://github.com/unitreerobotics/unitree_lerobot/blob/main/unitree_lerobot/utils/convert_unitree_json_to_lerobot.py#L154).\n\n```bash\n# --raw-dir     Corresponds to the directory of your JSON dataset\n# --repo-id     Your unique repo ID on Hugging Face Hub\n# --push_to_hub Whether or not to upload the dataset to Hugging Face Hub (true or false)\n# --robot_type  The type of the robot used in the dataset (e.g., Unitree_Z1_Single, Unitree_Z1_Dual, Unitree_G1_Dex1, Unitree_G1_Dex3, Unitree_G1_Brainco, Unitree_G1_Inspire,Unitree_G1_Dex1_Sim)\n\npython unitree_lerobot/utils/convert_unitree_json_to_lerobot.py \\\n    --raw-dir $HOME/datasets \\\n    --repo-id your_name/repo_task_name \\\n    --robot_type Unitree_G1_Dex3 \\\n    --push_to_hub\n```\n\n**Node:** `Unitree_G1_Dex1_Sim` is a robot type used for data collection in unitree_sim_isaaclab\n, with the head equipped with a single-viewpoint camera.\n\n# 3. 🚀 Training\n\n[For training, please refer to the official LeRobot training example and parameters for further guidance.](https://github.com/huggingface/lerobot/tree/main/docs/source)\n\n- `Train Act Policy` [Please refer to it in detail](https://github.com/huggingface/lerobot/blob/main/docs/source/act.mdx)\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_train.py \\\n    --dataset.repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --policy.push_to_hub=false \\\n    --policy.type=act\n```\n\n- `Train Diffusion Policy` [Please refer to it in detail](https://github.com/huggingface/lerobot/blob/main/docs/source/policy_diffusion_README.md)\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_train.py\\\n    --dataset.repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --policy.push_to_hub=false \\\n    --policy.type=diffusion\n```\n\n- `Train Pi0 Policy` [Please refer to it in detail](https://github.com/huggingface/lerobot/blob/main/docs/source/pi0.mdx)\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_train.py \\\n    --dataset.repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --policy.push_to_hub=false \\\n    --policy.type=pi0\n```\n\n- `Train Pi05 Policy` [Please refer to it in detail](https://github.com/huggingface/lerobot/blob/main/docs/source/pi05.mdx)\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_train.py \\\n    --dataset.repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --policy.type=pi05 \\\n    --output_dir=./outputs/pi05_training \\\n    --job_name=pi05_training \\\n    --policy.pretrained_path=lerobot/pi05_base \\\n    --policy.compile_model=true \\\n    --policy.gradient_checkpointing=true \\\n    --policy.dtype=bfloat16 \\\n    --policy.device=cuda \\\n    --policy.push_to_hub=false\n```\n\n- `Train Gr00t Policy` [Please refer to it in detail](https://github.com/huggingface/lerobot/blob/main/docs/source/groot.mdx)\n\n```bash\ncd unitree_lerobot/lerobot\n\npython src/lerobot/scripts/lerobot_train.py \\\n    --dataset.repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --output_dir=./outputs/groot_training \\\n    --policy.push_to_hub=false \\\n    --policy.type=groot \\\n    --policy.tune_diffusion_model=false \\\n    --job_name=groot_training\n```\n\nIf you want to use multi-GPU training, please refer to the details [here](https://github.com/huggingface/lerobot/blob/main/docs/source/multi_gpu_training.mdx)\n\n# 4. 🤖 Real-World Testing\n\nTo test your trained model on a real robot, you can use the eval_g1.py script located in the eval_robot folder. Here’s how to run it:\n\n[To open the image_server, follow these steps](https://github.com/unitreerobotics/avp_teleoperate?tab=readme-ov-file#31-%EF%B8%8F-image-server)\n\n```bash\n\n# --policy.path: Specifies the path to the pre-trained model, used for evaluating the policy.\n# --repo_id: The repository ID of the dataset, used to load the dataset required for evaluation.\n# --root: The root directory path of the dataset, defaults to an empty string.\n# --episodes: The number of evaluation episodes; setting it to 0 uses the default value.\n# --frequency: The evaluation frequency (in Hz), used to control the time step of the evaluation.\n# --arm: The model of the robotic arm, (e.g., G1_29, G1_23).\n# --ee: The type of end-effector, (e.g., dex3, dex1, inspire1, brainco).\n# --visualization: Whether to enable visualization; setting it to true enables it.\n# --send_real_robot: Whether to send commands to the real robot.\n\n\npython unitree_lerobot/eval_robot/eval_g1.py  \\\n    --policy.path=unitree_lerobot/lerobot/outputs/train/2025-03-25/22-11-16_diffusion/checkpoints/100000/pretrained_model \\\n    --repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --root=\"\" \\\n    --episodes=0 \\\n    --frequency=30 \\\n    --arm=\"G1_29\" \\\n    --ee=\"dex3\" \\\n    --visualization=true \\\n\nIf you want to run inference tests in the unitree_sim_isaaclab simulation environment, please execute:\n\n# --save_data: Allows recording data while running inference. At present, this option is limited to the sim environment.\n# --task_dir: the directory where data is stored\n# --max_episodes: the maximum number of inference runs per task; if exceeded, the task is considered failed by default\n\npython unitree_lerobot/eval_robot/eval_g1_sim.py  \\\n    --policy.path=unitree_lerobot/lerobot/outputs/train/2025-03-25/22-11-16_diffusion/checkpoints/100000/pretrained_model \\\n    --repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --root=\"\" \\\n    --episodes=0 \\\n    --frequency=30 \\\n    --arm=\"G1_29\" \\\n    --ee=\"dex3\" \\\n    --visualization=true \\\n    --save_data=false \\\n    --task_dir=\"./data\" \\\n    --max_episodes=1200\n\n# If you want to evaluate the model's performance on the dataset, use the command below for testing\npython unitree_lerobot/eval_robot/eval_g1_dataset.py  \\\n    --policy.path=unitree_lerobot/lerobot/outputs/train/2025-03-25/22-11-16_diffusion/checkpoints/100000/pretrained_model \\\n    --repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --root=\"\" \\\n    --episodes=0 \\\n    --frequency=30 \\\n    --arm=\"G1_29\" \\\n    --ee=\"dex3\" \\\n    --visualization=true \\\n    --send_real_robot=false\n```\n\n**Note:** If you are using the `unitree_sim_isaaclab` simulation environment, please refer to [unitree_sim_isaaclab](https://github.com/unitreerobotics/unitree_sim_isaaclab) for environment setup and usage instructions.\n\n# 5. 🎬 Replay Datasets On Robot\n\nThis section provides instructions on how to replay datasets on the robot.\nIt is useful for testing and validating the robot's behavior using pre-recorded data.\n\n```bash\n\n# --repo_id         Dataset repository ID on Hugging Face Hub (e.g., unitreerobotics/G1_Dex3_ToastedBread_Dataset)\n# --root            Path to the root directory of the dataset (leave empty to use the default cache path)\n# --episodes        Index of the episode to replay (e.g., 0 for the first episode)\n# --frequency       Replay frequency in Hz (e.g., 30 for 30 frames per second)\n# --arm             Type of robot arm used (e.g., G1_29, G1_23)\n# --ee              Type of end-effector used (e.g., dex3, dex1, inspire1, brainco)\n# --visualization   Enable or disable visualization during replay (true for enabling, false for disabling)\n\npython unitree_lerobot/eval_robot/replay_robot.py \\\n    --repo_id=unitreerobotics/G1_Dex3_ToastedBread_Dataset \\\n    --root=\"\" \\\n    --episodes=0 \\\n    --frequency=30 \\\n    --arm=\"G1_29\" \\\n    --ee=\"dex3\" \\\n    --visualization=true\n```\n\n# 6. 🤔 Troubleshooting\n\n| Problem                                                                                                                                                                                                                                     | Solution                                                       |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |\n| **Why use `LeRobot v2.0`?**                                                                                                                                                                                                                 | [Explanation](https://github.com/huggingface/lerobot/pull/461) |\n| **401 Client Error: Unauthorized** (`huggingface_hub.errors.HfHubHTTPError`)                                                                                                                                                                | Run `huggingface-cli login` to authenticate.                   |\n| **FFmpeg-related errors:** \u003cbr\u003e Q1: `Unknown encoder 'libsvtav1'` \u003cbr\u003e Q2: `FileNotFoundError: No such file or directory: 'ffmpeg'` \u003cbr\u003e Q3: `RuntimeError: Could not load libtorchcodec. Likely causes: FFmpeg is not properly installed.` | Install FFmpeg: \u003cbr\u003e `conda install -c conda-forge ffmpeg`     |\n| **Access to model `google/paligemma-3b-pt-224` is restricted.**                                                                                                                                                                             | Run `huggingface-cli login` and request access if needed.      |\n\n# 7. 🙏 Acknowledgement\n\nThis code builds upon following open-source code-bases. Please visit the URLs to see the respective LICENSES (If you find these projects valuable, it would be greatly appreciated if you could give them a star rating.):\n\n1. https://github.com/huggingface/lerobot\n2. https://github.com/unitreerobotics/unitree_sdk2_python\n3. https://github.com/unitreerobotics/xr_teleoperate\n4. https://github.com/unitreerobotics/unitree_sim_isaaclab\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitreerobotics%2Funitree_lerobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitreerobotics%2Funitree_lerobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitreerobotics%2Funitree_lerobot/lists"}