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

Reading data

Choose and configure Refiner readers for robotics data

Readers create the source of a Refiner pipeline. A reader is responsible for finding input files, planning shards, and emitting rows or table blocks.

1
2
3
import refiner as mdr

pipeline = mdr.read_lerobot("hf://datasets/lerobot/aloha_sim_transfer_cube_human")

Reader selection

Your data looks likeUseRead
LeRobot dataset rootread_lerobotLeRobot
One HDF5 file per episode, or grouped HDF5 demosread_hdf5HDF5
Zarr replay buffer with episode boundariesread_zarrZarr
MCAP robotics or autonomy logsread_mcapMCAP
Parquet, JSON, JSONL, CSV tablesread_parquet, read_json, read_jsonl, read_csvTabular Files
Raw files or media filesread_files, read_videosFiles and Videos
Hugging Face datasets tableread_hf_datasetHugging Face
TFRecord files or TensorFlow Datasetsread_tfrecords, read_tfdsTensorFlow
Versioned Lance datasetload_lanceLance
Your own source systemfrom_sourceCustom Readers

Core ideas

  • Readers plan shards, the units workers execute.
  • Readers emit rows or tabular blocks.
  • Robotics readers usually emit one row per episode.
  • Generic readers can be adapted into episode rows with to_robot_rows.

Read Reader Model and Sharding before writing large jobs.

Run a bounded quick test

Pass max_rows to a built-in reader before testing transforms or allocating a full pipeline run:

1
2
3
4
5
6
7
8
9
import refiner as mdr

pipeline = mdr.read_parquet(
    "s3://my-bucket/episodes/*.parquet",
    columns_to_read=["episode_id", "video"],
    max_rows=100,
)

rows = pipeline.take(5)

max_rows is a global source-output cap, not a per-worker cap. It applies after reader-level operations such as Parquet or Hugging Face filtering, but before pipeline transforms. A positive limit uses one source shard so multiple workers cannot each emit the requested number of rows. Consequently, num_workers="auto" starts at most one worker for a limited source. Set max_rows=0 to execute no source shards.

The option is available on read_csv, read_json, read_jsonl, read_files, read_videos, read_hdf5, read_zarr, read_mcap, read_parquet, read_hf_dataset, read_lerobot, read_tfrecords, read_tfds, and load_lance. All use the same bounded-source wrapper.

Readers stop before opening later source shards and slice the final Arrow batch. Refiner also reduces configurable batch or concurrency windows for Lance, Parquet, Hugging Face, file-content, Zarr, LeRobot, TFRecord, and TFDS readers; bounded split MCAP reads stream one episode at a time when the input supports it. A reader may still need to load one indivisible physical unit to produce a row—for example, one whole-file JSON document, HDF5 group, MCAP episode, or LeRobot episode. The limit bounds later work but cannot make that first logical row smaller.

// Table of Contents

  1. Reader selection
  2. Core ideas
  3. Run a bounded quick test
Macrodata_Labs
TermsPrivacyContact
  • GitHub
  • LinkedIn
  • X
  • HuggingFace
  • Discord