OA0
OA0 是一个探索 AI 的社区
现在注册
已注册用户请  登录
OA0  ›  代码  ›  LeRobot — Hugging Face 推出的开源机器人学习工具集

LeRobot — Hugging Face 推出的开源机器人学习工具集

 
  docker ·  2026-02-15 13:21:08 · 7 次点击  · 0 条评论  

LeRobot, Hugging Face 机器人库

[![测试](https://github.com/huggingface/lerobot/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/huggingface/lerobot/actions/workflows/nightly.yml?query=branch%3Amain) [![Python 版本](https://img.shields.io/pypi/pyversions/lerobot)](https://www.python.org/downloads/) [![许可证](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/huggingface/lerobot/blob/main/LICENSE) [![状态](https://img.shields.io/pypi/status/lerobot)](https://pypi.org/project/lerobot/) [![版本](https://img.shields.io/pypi/v/lerobot)](https://pypi.org/project/lerobot/) [![贡献者公约](https://img.shields.io/badge/Contributor%20Covenant-v2.1-ff69b4.svg)](https://github.com/huggingface/lerobot/blob/main/CODE_OF_CONDUCT.md) [![Discord](https://img.shields.io/badge/Discord-加入我们-5865F2?style=flat&logo=discord&logoColor=white)](https://discord.gg/q8Dzzpym3f)

LeRobot 旨在为现实世界的机器人技术提供基于 PyTorch 的模型、数据集和工具。目标是降低入门门槛,让每个人都能从共享数据集和预训练模型中受益并为其做出贡献。

🤗 硬件无关的 Python 原生接口:标准化了从低成本机械臂 (SO-100) 到人形机器人等多样化平台的控制。

🤗 标准化、可扩展的 LeRobotDataset 格式 (Parquet + MP4 或图像),托管在 Hugging Face Hub 上,支持海量机器人数据集的存储、流式传输和可视化。

🤗 经过验证可迁移到现实世界的先进策略,支持训练和部署。

🤗 对开源生态系统的全面支持,旨在普及物理人工智能。

快速开始

LeRobot 可以直接从 PyPI 安装。

pip install lerobot
lerobot-info

[!IMPORTANT]
详细的安装指南,请参阅 安装文档

机器人与控制

Reachy 2 演示

LeRobot 提供了一个统一的 Robot 类接口,将控制逻辑与硬件细节解耦。它支持广泛的机器人和遥操作设备。

from lerobot.robots.myrobot import MyRobot

# 连接到机器人
robot = MyRobot(config=...)
robot.connect()

# 读取观测并发送动作
obs = robot.get_observation()
action = model.select_action(obs)
robot.send_action(action)

支持的硬件:SO100, LeKiwi, Koch, HopeJR, OMX, EarthRover, Reachy2, 游戏手柄, 键盘, 手机, OpenARM, Unitree G1。

虽然这些设备已原生集成到 LeRobot 代码库中,但该库被设计为可扩展的。您可以轻松实现 Robot 接口,以便将 LeRobot 的数据收集、训练和可视化工具用于您自己的自定义机器人。

详细的硬件设置指南,请参阅 硬件文档

LeRobot 数据集

为了解决机器人领域的数据碎片化问题,我们采用了 LeRobotDataset 格式。

  • 结构:用于视觉的同步 MP4 视频(或图像)和用于状态/动作数据的 Parquet 文件。
  • HF Hub 集成:在 Hugging Face Hub 上探索数千个机器人数据集。
  • 工具:无缝删除片段、按索引/比例分割、添加/删除特征以及合并多个数据集。
from lerobot.datasets.lerobot_dataset import LeRobotDataset

# 从 Hub 加载数据集
dataset = LeRobotDataset("lerobot/aloha_mobile_cabinet")

# 访问数据(自动处理视频解码)
episode_index=0
print(f"{dataset[episode_index]['action'].shape=}\n")

了解更多信息,请参阅 LeRobotDataset 文档

先进模型

LeRobot 以纯 PyTorch 实现了先进的策略,涵盖模仿学习、强化学习和视觉-语言-动作模型,更多模型即将推出。它还提供了工具来监控和检查您的训练过程。

Gr00t 架构

训练一个策略就像运行一个脚本配置一样简单:

lerobot-train \
  --policy=act \
  --dataset.repo_id=lerobot/aloha_mobile_cabinet
类别 模型
模仿学习 ACT, Diffusion, VQ-BeT
强化学习 HIL-SERL, TDMPC & QC-FQL (即将推出)
VLA 模型 Pi0Fast, Pi0.5, GR00T N1.5, SmolVLA, XVLA

与硬件类似,您可以轻松实现自己的策略,并利用 LeRobot 的数据收集、训练和可视化工具,并将您的模型分享到 HF Hub。

详细的策略设置指南,请参阅 策略文档

推理与评估

使用统一的评估脚本在仿真或真实硬件上评估您的策略。LeRobot 支持标准基准测试,如 LIBEROMetaWorld 等(更多即将推出)。

# 在 LIBERO 基准上评估策略
lerobot-eval \
  --policy.path=lerobot/pi0_libero_finetuned \
  --env.type=libero \
  --env.task=libero_object \
  --eval.n_episodes=10

了解如何实现您自己的仿真环境或基准测试,并通过 HF Hub 分发,请遵循 EnvHub 文档

资源

引用

如果您在项目中使用 LeRobot,请引用 GitHub 仓库以感谢持续的开发和贡献者:

@misc{cadene2024lerobot,
    author = {Cadene, Remi and Alibert, Simon and Soare, Alexander and Gallouedec, Quentin and Zouitine, Adil and Palma, Steven and Kooijmans, Pepijn and Aractingi, Michel and Shukor, Mustafa and Aubakirova, Dana and Russi, Martino and Capuano, Francesco and Pascal, Caroline and Choghari, Jade and Moss, Jess and Wolf, Thomas},
    title = {LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch},
    howpublished = "\url{https://github.com/huggingface/lerobot}",
    year = {2024}
}

如果您引用我们的研究或学术论文,请同时引用我们的 ICLR 出版物:

ICLR 2026 论文
@inproceedings{cadenelerobot,
  title={LeRobot: An Open-Source Library for End-to-End Robot Learning},
  author={Cadene, Remi and Alibert, Simon and Capuano, Francesco and Aractingi, Michel and Zouitine, Adil and Kooijmans, Pepijn and Choghari, Jade and Russi, Martino and Pascal, Caroline and Palma, Steven and Shukor, Mustafa and Moss, Jess and Soare, Alexander and Aubakirova, Dana and Lhoest, Quentin and Gallou\'edec, Quentin and Wolf, Thomas},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026},
  url={https://arxiv.org/abs/2602.22818}
}

贡献

我们欢迎社区中的每个人做出贡献!要开始贡献,请阅读我们的 CONTRIBUTING.md 指南。无论您是添加新功能、改进文档还是修复错误,您的帮助和反馈都是无价的。我们对开源机器人技术的未来感到无比兴奋,并迫不及待地想与您一起探索接下来的发展——感谢您的支持!

SO101 视频

LeRobot 团队在 Hugging Face 用 ❤️ 构建
7 次点击  ∙  0 人收藏  
登录后收藏  
0 条回复
关于 ·  帮助 ·  PING ·  隐私 ·  条款   
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
耗时 26 ms
Developed with Cursor