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

Multimodal and structured output

Send media to models and validate structured model responses

Refiner can pass text, images, videos, and files to supported providers.

Image content

1
2
3
4
5
6
7
8
9
10
11
12
13
14
async def describe_first_frame(row, generate_text):
    frame = await anext(row.videos["front"].iter_numpy_frames())
    response = await generate_text(
        messages=[
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": "Describe the robot state."},
                    {"type": "image", "image": frame},
                ],
            }
        ],
    )
    return row.update({"description": response.text})

Video content

Some providers accept video content. For providers that do not, use sampled frames or contact sheets. The subtask annotation operation uses contact sheets; see Subtask Annotation.

Structured output

Use a Pydantic model when you need validated fields:

1
2
3
4
5
6
7
8
class Segment(BaseModel):
    start_sec: float
    end_sec: float
    label: str


class Segments(BaseModel):
    segments: list[Segment]

Then pass schema=Segments to generate_text.

Raw payloads

Use raw_payload only when a provider requires options that are not represented by the common interface:

1
2
3
4
5
6
response = await generate_text(
    raw_payload={
        "messages": [{"role": "user", "content": "Return JSON."}],
        "response_format": {"type": "json_object"},
    }
)

Prefer the typed interface unless you need provider-specific behavior.

// Table of Contents

  1. Image content
  2. Video content
  3. Structured output
  4. Raw payloads
Macrodata_Labs
TermsPrivacyContact
  • GitHub
  • LinkedIn
  • X
  • HuggingFace
  • Discord