了解LeRobot数据集格式
学习路径的第二单元.学习LeRobot数据集格式:Parquet + MP4存储,集集结构,观察/行动方案.从HuggingFace Hub上载和可视化现有数据集. ~1.5小时.
数据集格式 · ~1.5小时
在记录自己的数据之前,请了解LeRobot数据集包含什么,节目是如何结构化的,存储的领域以及如何从HuggingFace Hub上载和检查现有数据集.
为什么标准格式很重要
机器人学习历史上一直受到使用不同的数据格式的每个实验室的影响.因此无法共享数据集,将不同机器人的数据组合在一起,或在系统中使用预先训练的政策.LeRobot数据集格式通过定义一个单一的方案来解决这一问题. 在SO-100上记录的数据集可以用于没有任何转换的OpenArm政策培训,只要行动空间尺寸匹配.
在训练中,理解录音前的格式意味着您不会发现数据中的结构问题.
数据集结构: 套件+MP4
每个LeRobot数据集都包含以下结构的目录:
帕克特 (数值时间系列) 和MP4 (视频) 之间的分离是故意的.帕克特有效地压缩联合状态和操作,并支持节目指数的快速随机访问.MP4使用用于图像序列的视频编码器,产生比存储原始图像为
每个集中的关键领域
| Field | Shape | Description |
|---|---|---|
| observation.state | [T, D] | Joint positions (and optionally velocities) at each timestep. D is the number of joints (e.g., 7 for SO-100: 6 joints + 1 gripper). |
| action | [T, D] | Target joint positions commanded at each timestep. Same dimensionality as observation.state. |
| timestamp | [T] | Time in seconds since the start of the episode, at 50Hz by default (0.02s per step). |
| episode_index | scalar | Integer index of this episode within the dataset. Used by the dataloader to group timesteps into episodes. |
| frame_index | [T] | Frame number within the episode (0 to T-1). Matches the frame number in the corresponding MP4. |
| next.done | [T] | Boolean flag — True at the last timestep of an episode. Used to signal episode boundaries during training. |
| task_index | scalar | Index into tasks.jsonl. Enables multi-task datasets where different episodes correspond to different instructions. |
**摄像头场:**摄像头图像是作为MP4文件存储的,而不是在Parquet.Parquet包含
装载和可视化现有数据集
从HuggingFace Hub中加载
source ~/lerobot-env/bin/activate # 查看公共数据集中的3集python -m lerobot.scripts.visualize_dataset \ --repo-id lerobot-raw/aloha_sim_insertion_scripted \ --episode-indices 0 1 2 \ --output-dir ~/dataset-viz/ # 打开浏览器中的生成的HTML # 文件路径打印到终端,例如 ~/dataset-viz/index.html
视觉化器生成一个HTML页面,并与同步的联合状态图片一起播放每个集的视频.
- 滑
关节轨迹 尖尖点表明记录文物或臂部撞击 - ** 频段长度一致**
频段长度大大不同 (例如50个相对400个相对) 通常表明一些演示记录了部分或被取消的运动 - 抓住器状态的变化
最后一个联合维度应显示操作任务的明确二进制转换 (开 → 关 → 开)
通过程序检查数据集从 lerobot.common.datasets.lerobot_datasets 导入 LeRobotDataset数据集 = LeRobotDataset("lerobot-raw/aloha_sim_insertion_scripted") 打印(f"剧集: {dataset.number_episodes}") 打印(f"总框架: {len(datasets)}") 打印(f"FPS: {dataset.fps}") 打印(f"特征: {(listdataset.features.keys)))))) #检查单个图库=\0[[] 打印形式: {[observation.state'shapes.}") 打印形式: {[\'shapes.}"
选择性
探索RCSV数据集
库里包含了LeRobot格式的机器人学习数据集.在记录自己的任务之前,浏览它们以了解不同任务和硬件的外观.
单元2完成,当...
您已经成功地查看了3集从
[← 回到路径概述]







