Skip to content

Add zarr2lerobot converter#6

Merged
Selen-Suyue merged 1 commit into
mainfrom
zbzhu/lerobot
Apr 11, 2026
Merged

Add zarr2lerobot converter#6
Selen-Suyue merged 1 commit into
mainfrom
zbzhu/lerobot

Conversation

@zbzhu99

@zbzhu99 zbzhu99 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Adds tools/zarr2lerobot/, an offline converter that reads the aggregated zarr produced by tools/process_demo_data.py and emits a LeRobot Dataset v3.0 directory via the official lerobot SDK.

Features:

  • Both joint and cartesian control modes (cartesian enforced as 8-dim: tcp_position + tcp_orientation + gripper)
  • Task text from CLI --task with per-episode description fallback
  • Bulk per-episode zarr slicing (one chunk decompression per array per episode, not per frame) so large datasets are not O(frames) in read I/O
  • argparse CLI entry point (python -m tools.zarr2lerobot.convert_zarr_to_lerobot)
  • Depth frames are intentionally skipped in v1; the v3 ecosystem has no consensus storage format for depth yet

Tests:

  • 22 pytest cases (unit helpers + end-to-end round-trip on synthetic fixture) passing on both joint and cartesian modes
  • Verified on a real 50-episode / 7075-frame cartesian recording; output loads back via LeRobotDataset with correct episode/frame boundaries

The lerobot extra in setup.py is pinned to >=0.4.0,<0.5 from PyPI. 0.4.x is the last series that ships Dataset v3.0 while still supporting Python 3.10 (0.5.0+ requires >=3.12, which breaks the unicon env).

Also adds a README section for the new export path and a .gitignore negation for tools/zarr2lerobot/tests/ (repo has a blanket tests/ ignore).

Adds tools/zarr2lerobot/, an offline converter that reads the aggregated
zarr produced by tools/process_demo_data.py and emits a LeRobot Dataset
v3.0 directory via the official lerobot SDK.

Features:
- Both joint and cartesian control modes (cartesian enforced as 8-dim:
  tcp_position + tcp_orientation + gripper)
- Task text from CLI --task with per-episode description fallback
- Bulk per-episode zarr slicing (one chunk decompression per array per
  episode, not per frame) so large datasets are not O(frames) in read I/O
- argparse CLI entry point (python -m tools.zarr2lerobot.convert_zarr_to_lerobot)
- Depth frames are intentionally skipped in v1; the v3 ecosystem has no
  consensus storage format for depth yet

Tests:
- 22 pytest cases (unit helpers + end-to-end round-trip on synthetic
  fixture) passing on both joint and cartesian modes
- Verified on a real 50-episode / 7075-frame cartesian recording; output
  loads back via LeRobotDataset with correct episode/frame boundaries

The lerobot extra in setup.py is pinned to >=0.4.0,<0.5 from PyPI. 0.4.x
is the last series that ships Dataset v3.0 while still supporting Python
3.10 (0.5.0+ requires >=3.12, which breaks the unicon env).

Also adds a README section for the new export path and a .gitignore
negation for tools/zarr2lerobot/tests/ (repo has a blanket tests/ ignore).
@zbzhu99
zbzhu99 requested a review from Selen-Suyue April 10, 2026 14:20
@Selen-Suyue
Selen-Suyue merged commit c8e375f into main Apr 11, 2026
1 check passed
@Selen-Suyue
Selen-Suyue deleted the zbzhu/lerobot branch April 11, 2026 12:25
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.

2 participants