Skip to content

[python] Export LeRobot v2 and v3 datasets from Paimon - #11299

Draft
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:python-lerobot-export-v2-v3
Draft

XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:python-lerobot-export-v2-v3

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

A LeRobot table group can be imported into Paimon but cannot be exported as a standalone LeRobot dataset. Add conn.export_to_lerobot(...) for LeRobot v2.0, v2.1, and v3.0, targeting either a local directory or oss://bucket/prefix. Multi-source groups select one source by _datasets.id; tagged groups can export a fixed snapshot.

V3 preserves source-local indices and copies each shared encoded MP4 once. V2 writes one Parquet and one H.264 MP4 per Episode and camera, with the v2.0 global-statistics and v2.1 per-Episode-statistics metadata layouts. The exporter supports imported groups and PaimonLeRobotWriter groups. A small sidecar preserves the Paimon Dataset ID, name, and extra text fields outside the LeRobot schema. OSS output can use the table's FileIO or separate output_options; it stages files in local temporary storage and uploads meta/info.json last. Failed uploads leave their prefix for inspection/retry under a new prefix.

Validation: related LeRobot tests 410 passed, 9 skipped; flake8 and git diff --check passed. A real 224-frame, two-camera sample exported to v3 with source info.json, Episode Parquet, and frame Parquet values unchanged, and encoded MP4 bytes preserved. The same output was uploaded to OSS, read back with matching MP4 SHA-256, and reimported from OSS into a fresh Paimon warehouse with 224 frames and two videos. OSS test objects were removed. Official LeRobot v0.4.4 read valid v3 frames; v0.3.3 read all tested v2.0/v2.1 frames, including video. The source's final frame has a null subtask_index, which the older official v3 reader also rejects in the original dataset; export preserves it.

@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as draft November 20, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant