Skip to content

create_zarr_from_lerobot

create_zarr_from_lerobot

Creates a Zarr-based replay buffer dataset from LeRobot datasets.

create_replay_buffer_from_lerobot

create_replay_buffer_from_lerobot(schema)

Creates a Zarr-based replay buffer from a LeRobot dataset.

Parameters:

Name Type Description Default
schema LeRobotDatasetSchemaV30

LeRobotDatasetSchemaV30 instance.

required
Source code in src/versatil/data/preprocessing/create_zarr_from_lerobot.py
def create_replay_buffer_from_lerobot(schema: LeRobotDatasetSchemaV30) -> None:
    """Creates a Zarr-based replay buffer from a LeRobot dataset.

    Args:
        schema: LeRobotDatasetSchemaV30 instance.
    """
    total_episodes = schema.lerobot_metadata.get_total_episodes()
    episodes = _iter_lerobot_episodes(
        schema=schema,
        total_episodes=total_episodes,
    )

    create_zarr_replay_buffer(
        schema=schema,
        episodes=episodes,
        total_episodes=total_episodes,
    )