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

Zarr reader

Read Zarr replay buffers and episode ranges

Use read_zarr for replay buffers stored as Zarr groups or zipped Zarr stores.

Episode ranges

Many robotics replay buffers store frame-aligned arrays and cumulative episode ends:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import refiner as mdr

pipeline = (
    mdr.read_zarr(
        "hf://datasets/acme/robot_buffer/buffer.zarr",
        arrays={
            "action": "data/action",
            "eef_pos": "data/eef_pos",
            "joint_pos": "data/joint_pos",
            "wrist": "data/wrist_rgb",
        },
        row_ends="meta/episode_ends",
        index_column="episode_id",
    )
    .to_robot_rows(
        episode_id_key="episode_id",
        action_key="action",
        state_key=("eef_pos", "joint_pos"),
        video_keys=("wrist",),
    )
)

With row_ends, each emitted row contains one episode range. Refiner never splits a row across episode boundaries.

Leading-axis rows

For arrays where each leading-axis item is one row:

1
2
3
4
5
pipeline = mdr.read_zarr(
    "/data/features.zarr",
    arrays={"embedding": "embeddings", "score": "scores"},
    split_leading_axis=True,
)

Use this for non-episode arrays or precomputed feature tables.

Selected arrays and attributes

arrays and attrs can be mappings from output column name to Zarr path:

1
2
3
4
5
pipeline = mdr.read_zarr(
    "/data/run.zarr",
    arrays={"action": "data/action"},
    attrs={"task": "meta/task"},
)

Related pages

  • Converting to Robot Rows
  • Zarr Replay Buffer Example
  • Writing Zarr

// Table of Contents

  1. Episode ranges
  2. Leading-axis rows
  3. Selected arrays and attributes
  4. Related pages
Macrodata_Labs
TermsPrivacyContact
  • GitHub
  • LinkedIn
  • X
  • HuggingFace
  • Discord