rerun-lerobot
Original:🇺🇸 English
Translated
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 RrdReader + send_chunks per-episode split, and when to drop to ParquetReader for custom control.
18installs
Sourcererun-io/rerun
Added on
NPX Install
npx skill4agent add rerun-io/rerun rerun-lerobotTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Rerun LeRobot ingestion
Rerun has a built-in LeRobot importer: point (or the viewer, or on the CLI) at the dataset directory and it ingests episodes, camera videos, and state/action tables with no conversion code.
There is no chunk-level ; the chunk-processing route is to import first, then reprocess the resulting RRD with .
log_file_from_pathrerun <dir>LeRobotReaderRrdReaderThe download step needs
.
huggingface_hubStep 1: dataset -> one combined RRD
python
from huggingface_hub import snapshot_download
import rerun as rr
dataset_dir = snapshot_download(repo_id="rerun/so101-pick-and-place", 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 importerThe importer emits one recording per episode (recording ids like ), plus a metadata-only root recording, all into the single RRD.
episode_1rr.RecordingStreamlog_file_from_pathRecordingStreamrr.logRrdReaderrerun-chunk-processingStep 2: split into per-episode RRDs
Catalog segments are one-recording-per-file, and becomes the segment id on registration.
Split with :
recording_idRrdReaderpython
reader = rr.experimental.RrdReader(str(combined_rrd))
for entry in reader.recordings():
store = reader.store(store=entry)
if not store.schema().entity_paths(): # skip the metadata-only root recording
continue
episode_id = zero_pad(entry.recording_id) # episode_1 -> episode_00001
with rr.RecordingStream("rerun_example_lerobot", recording_id=episode_id, send_properties=False) as rec:
rec.save(str(rrd_dir / f"{episode_id}.rrd"))
rec.send_chunks(store)Two non-obvious moves:
- Zero-pad the episode id. sorts before
episode_10lexicographically; segment tables and viewers sort lexicographically. Pad to a fixed width when re-assigningepisode_2.recording_id - on the new stream, so the copy doesn't inject fresh recording properties on top of the copied chunks.
send_properties=False
send_chunksrecording_idIf episodes need cleanup (drop topics, fix data, add derived components), run the store through lenses between read and write: then (see ).
reader.stream(store=entry).drop(...).lenses(...)collect().write_rrd(..., recording_id=episode_id)rerun-chunk-processingComputed layers and per-episode properties then follow the standard patterns in (layer must equal the episode segment id).
rerun-data-modelrecording_idGotchas
- must target the dataset root directory, not a file inside it.
log_file_from_path - Unpadded episode ids sort incorrectly downstream; pad before registering.
- The combined RRD contains a metadata-only root recording; skip stores with no entity paths or you register an empty segment.
References
https://github.com/rerun-io/rerun/tree/main/examples/python/dataloader(download → import → split → register, complete and runnable) andprepare_dataset.py(training-side consumption viatrain.py)rerun.experimental.dataloader