跳到正文
Skillpedia
分析与电子表格12k · #11554

rerun-lerobot

它能做什么

该技能说明如何把 Hugging Face 上的 LeRobot 数据集导入 Rerun 工具。适用于处理机器人学习数据、并希望查看或转换数据的人。

适用场景

  • ✓当你想在 Rerun 中打开 LeRobot 数据集文件夹,查看其视频和关节数据时。
  • ✓当你需要把 LeRobot 数据集拆分为独立的 Rerun 文件,每个片段一个时。
  • ✓当你只想下载 LeRobot 数据集的一部分,例如前几个片段时。

技能链接

https://github.com/rerun-io/rerun/blob/main/skills/rerun-lerobot/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/rerun-io/rerun/blob/main/skills/rerun-lerobot/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我把这个来自 Hugging Face 的 LeRobot 数据集加载到 Rerun 中,以便我查看各个片段。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能会告诉智能体哪种方法合适:查看时使用内置导入器,转换时使用逐片段读取器。它还会检查数据集版本,判断能否部分下载。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Rerun LeRobot ingestion

There are two ways in, and which one you want depends on whether you are viewing or converting.

  • Just viewing? Rerun has a built-in LeRobot importer: point log_file_from_path (or the viewer, or rerun <dir> on the CLI) at the dataset directory and it ingests episodes, camera videos, and state/action tables with no conversion code.
  • Converting? rr.experimental.LeRobotReader reads the dataset one episode at a time as a lazy chunk stream, which is what you want for per-episode RRDs and for lenses.

The download step needs huggingface_hub.

Step 0: pick a dataset and check the HF token

Both scripts below live in scripts/ next to this file, and run standalone through uv — they declare huggingface_hub inline, so there is no environment to set up.

Two facts decide what a dataset costs to fetch, and the Hub search results show neither. Get both, for every candidate, in one call:

uv run scripts/find_lerobot_dataset.py <query> --robot-type <robot> --want 5

codebase_version decides whether a partial download is possible at all.

  • v2.1 and earlier store one parquet and one mp4 per episode (video_path ends in episode_{episode_index:06d}.mp4), so "just the first N episodes" downloads only those episodes.
  • v3.0 concatenates every episode into a few large files (video_path ends in file-{file_index:03d}.mp4), so any subset costs the whole download. If the user asked for a few episodes, prefer a v2.1 dataset — for the download only. LeRobotReader reads a single episode out of either version once the files are local.

How camera frames are stored decides the size, and it varies by two orders of magnitude. The frames and MB/ep columns report it:

  • mp4: a video-dtype feature, one file per episode beside the parquet.
  • inline: an image-dtype feature, raw frames inside the episode parquet, which is far larger for the same footage.

Both scripts report the actual size for the dataset in hand, so use that number rather than guessing. Tell the user the size before you start the download, and prefer mp4 unless they asked for something only the other set has.

HF_TOKEN is not required for public datasets, but without it the Hub rate-limits and throttles downloads. If it is unset, say so and point the user at https://huggingface.co/settings/tokens to create a read token, then export HF_TOKEN=hf_… (or hf auth login). Do not block on it — carry on unauthenticated and let the user decide.

[ -n "$HF_TOKEN" ] || echo "HF_TOKEN unset — downloads will be throttled"

Step 1: dataset -> one combined RRD

Only needed if you want every episode in one file — to hand someone a single RRD, or to reprocess data you cannot re-read from the dataset directory. For per-episode segments, skip to Step 2 and let LeRobotReader read the dataset directly.

from huggingface_hub import snapshot_download
import rerun as rr

dataset_dir = snapshot_download(repo_id=repo_id, repo_type="dataset", local_dir=dest)

with rr.RecordingStream("rerun_example_lerobot") as rec:
    rec.save(str(combined_rrd))
    rec.log_file_from_path(str(dataset_dir))  # the built-in importer

The importer emits one recording per episode (recording ids like episode_1), plus a metadata-only root recording, all into the single RRD.

rr.RecordingStream + log_file_from_path here is the importer bootstrap — the one place RecordingStream is correct in an ingestion pipeline (it drives the built-in importer, not per-message logging). Do not generalize it to rr.log-per-message loops; for everything after import, reprocess with a reader + lenses (see rerun-chunk-processing: Chunk API vs logging API).

Downloading only the first few episodes

uv run scripts/fetch_lerobot_episodes.py <repo_id> --episodes 5   # prints the dataset directory

It reports the download size before starting, downloads meta/* plus the wanted episode_%06d files, trims meta/ to match, verifies that exactly the requested episodes landed, and prints what it got. Its last line is the dataset directory; do not follow it with find or du. Do the equivalent by hand and three things bite:

  • The importer iterates the episode list in meta/, so an untrimmed meta/ warns once per absent episode.
  • snapshot_download writes into an existing directory, so episodes left by an earlier run with a different N survive and inflate the result.
  • Bot
常见问题

我需要 Hugging Face 令牌吗?

下载步骤需要 huggingface_hub 库和 Hugging Face 令牌,该技能会先检查令牌。

查看和转换有什么区别?

查看会对数据集文件夹使用 Rerun 的内置导入器。转换则一次读取一个片段,使每个片段都能单独保存。

我能只下载前几个片段吗?

对于 2.1 及更早的数据集版本,通常可以,因为它们每个片段存储一个文件。3.0 版本则把片段合并为几个大文件,因此比较困难。

详情

作者的原始描述

Ingest a LeRobot (HuggingFace) dataset into Rerun. Read when converting a LeRobot dataset to RRDs, splitting it into per-episode segments, or registering it on a Rerun catalog. Covers the built-in directory importer (log_file_from_path), the per-episode LeRobotReader, and when to drop to ParquetReader for custom control.

repo: rerun-io/rerun

热度

GitHub 星标
12k
排名
#11554
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能