Macrodata_Labs
AboutBlogDemo
Announcing MacroHands, our SOTA model for 3D hands and camera path from egocentric video!
// Docs›
Quickstart
Running pipelines
  • In-process debugging
  • Local launcher
Reading data
  • Reader model
  • Sharding
  • LeRobot reader
  • HDF5 reader
  • Zarr reader
  • MCAP reader
  • Tabular files
  • Files and videos
  • Hugging Face
  • TensorFlow
  • Lance
  • Custom readers
Episode data
  • Episode rows
  • Frames and videos
  • Metadata, tasks, and stats
  • Converting to robot rows
Transforms
  • Row transforms
  • Async and batch transforms
  • Vectorized transforms
  • Expressions
  • Schemas and DTypes
Episode operations
  • Motion trimming
  • Subtask annotation
Inference
  • Generate text
  • Multimodal and structured output
  • Inference providers
  • Pooling
Writing data
  • Writer model
  • LeRobot writer
  • Zarr writer
  • Parquet and JSONL writers
  • Lance
  • Media assets and reducers
Examples
  • ALOHA HDF5
  • robomimic HDF5
  • Zarr replay buffer
  • MCAP Franka
  • LIBERO HDF5
  • Merge LeRobot datasets
  • Annotate subtasks
Reference
  • Path formats
  • Optional dependencies
// Docs
Quickstart
Running pipelines
  • In-process debugging
  • Local launcher
Reading data
  • Reader model
  • Sharding
  • LeRobot reader
  • HDF5 reader
  • Zarr reader
  • MCAP reader
  • Tabular files
  • Files and videos
  • Hugging Face
  • TensorFlow
  • Lance
  • Custom readers
Episode data
  • Episode rows
  • Frames and videos
  • Metadata, tasks, and stats
  • Converting to robot rows
Transforms
  • Row transforms
  • Async and batch transforms
  • Vectorized transforms
  • Expressions
  • Schemas and DTypes
Episode operations
  • Motion trimming
  • Subtask annotation
Inference
  • Generate text
  • Multimodal and structured output
  • Inference providers
  • Pooling
Writing data
  • Writer model
  • LeRobot writer
  • Zarr writer
  • Parquet and JSONL writers
  • Lance
  • Media assets and reducers
Examples
  • ALOHA HDF5
  • robomimic HDF5
  • Zarr replay buffer
  • MCAP Franka
  • LIBERO HDF5
  • Merge LeRobot datasets
  • Annotate subtasks
Reference
  • Path formats
  • Optional dependencies

Converting to robot rows

Map generic rows into Refiner's robotics episode view

Use to_robot_rows(...) when a generic reader produces episode-shaped rows that should be treated as robotics episodes.

Basic mapping

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pipeline = (
    mdr.read_hdf5(
        "/data/aloha/*.hdf5",
        datasets={
            "action": "action",
            "qpos": "observations/qpos",
            "front": "observations/images/front",
        },
        file_path_column="episode_file",
    )
    .to_robot_rows(
        episode_id_key="episode_file",
        action_key="action",
        state_key="qpos",
        video_keys=("front",),
        fps=30.0,
        robot_type="aloha",
    )
)

The input columns remain available by their original names. The robotics view adds semantic properties such as row.actions, row.states, and row.videos.

Key mapping

OptionUse it for
episode_id_keySource column or slash path for episode identity.
task_keySource column or slash path containing task text. Strings become row.tasks = [task]; string sequences are preserved.
fps or fps_keyLiteral fps or source column for fps.
robot_type or robot_type_keyLiteral robot type or source column.
timestamp_keyFrame-aligned timestamp column. If missing and fps is known, timestamps are generated from frame indices.
action_keyFrame-aligned action column.
state_keyOne state column or several columns concatenated as state.
extra_observation_keysAdditional observations exposed by name.
video_keysVideo columns exposed through row.videos.

Multiple state columns

1
2
3
4
pipeline = source.to_robot_rows(
    action_key="actions",
    state_key=("joint_pos", "joint_vel", "eef_pos", "gripper_qpos"),
)

Tuple state keys are concatenated into row.states and exposed as observation.state.

Nested frame data

If a row contains a nested frame table, pass nested_frames_key:

1
2
3
4
5
pipeline = source.to_robot_rows(
    nested_frames_key="frames",
    action_key="action",
    state_key="observation.state",
)

This is useful for custom readers that already group frames per episode. For RLDS-style rows, task_key can point into the nested frame data, such as task_key="steps/language_instruction".

Writing converted rows

Converted rows can be written as LeRobot:

1
pipeline.write_lerobot("hf://buckets/acme-robotics/converted-dataset")

See Writing LeRobot.

// Table of Contents

  1. Basic mapping
  2. Key mapping
  3. Multiple state columns
  4. Nested frame data
  5. Writing converted rows
Macrodata_Labs
TermsPrivacyContact
  • GitHub
  • LinkedIn
  • X
  • HuggingFace
  • Discord