Now recruiting capture teams worldwide. Get paid to record first-person video of real work.

Apply to capture

Guide

How to Convert UMI Data to HDF5

An array-to-dataset mapping, step list and checks for writing a UMI Zarr replay buffer as an HDF5 file, from the UMI repository, the HDF Group documentation and the h5py documentation.
By the Firsthand capture teamLast updated November 27, 2026

Short answer

The UMI repository writes a Zarr replay buffer, dataset.zarr.zip, with per-step arrays and episode_ends. An HDF5 file holds groups, datasets and attributes in a hierarchy the application chooses. Converting means mapping those arrays and episodes into a layout you define. Neither the UMI nor the HDF5 sources document a UMI-to-HDF5 converter.

Last reviewed:

What does the UMI pipeline output?

The official UMI repository (opens in a new tab) documents one training format. Its README runs scripts_slam_pipeline/07_generate_replay_buffer.py with an output path ending in dataset.zarr.zip, and the training commands point task.dataset_path at that file. The README names no HDF5, LeRobot, RLDS or MCAP output. The UMI Zarr replay buffer entry is the site definition, and UMI dataset formats compares the formats.

The ReplayBuffer class in the repo asserts a data group and a meta group, an int64 episode_ends array in meta, and a first dimension in every data array equal to the last value of episode_ends. Its docstring calls it a Zarr-based temporal data structure whose first dimension is time and which chunks only along time, so all episodes sit one after another on that axis. For each gripper i the script writes robot{i}_eef_pos and robot{i}_eef_rot_axis_angle (float32), robot{i}_gripper_width (float32, with a trailing axis of length one), robot{i}_demo_start_pose and robot{i}_demo_end_pose, and for each camera j camera{j}_rgb.

The script writes no action array, no IMU array, no timestamp array, and no task text, reward or success and failure label. Images are not the original video: the script inpaints detected tags, masks the gripper, resizes to an output resolution set by an option (default 224,224) and stores uint8 RGB frames, one frame per chunk, with a JPEG XL codec the repo registers (level 99 by default). The UMI paper (opens in a new tab) describes a handheld gripper with a wrist-mounted fisheye camera and pose recovered after recording with visual-inertial SLAM.

How is an HDF5 file organised?

Per the HDF5 data model chapter (opens in a new tab) from The HDF Group, an HDF5 group is analogous to a file system directory, an HDF5 dataset is a multidimensional (rectangular) array of data elements, and every file has at least one object, the root group. The groups chapter (opens in a new tab) says the graph of objects is navigated with path names analogous to Unix file systems.

The h5py quick start (opens in a new tab) puts it in Python terms: a file is a container for datasets, which are array-like collections of data, and groups, which are folder-like containers holding datasets and other groups. Groups work like dictionaries and datasets work like NumPy arrays. The File object is itself the root group, named /, and creating a dataset with a full path also creates the intermediate groups.

  • Group: a directory-like container of datasets and other groups, reached by a path.
  • Dataset: a rectangular array with a shape and a data type, read and written with NumPy-style slicing in h5py.
  • Attribute: a small named value attached to a group or dataset. The data model chapter says it should be a small object, is read or written in a single access with no partial reading, and cannot carry attributes of its own. The h5py attributes page (opens in a new tab) says each attribute should generally be under 64k.

The data model chapter also says the application maps its own data structures to a hierarchy of HDF5 objects, and that each application creates the mapping best suited to its purposes. That is why this guide proposes a layout rather than reciting one. Neither HDF5 source defines an episode, an observation or an action, and the UMI sources define no HDF5 layout.

Is there an official UMI-to-HDF5 converter?

Not in the sources read. The UMI README documents Zarr only and names no converter. The HDF Group and h5py documentation describe the file format and the Python interface and name no UMI. Conversion is therefore an approach a lab implements itself: read the replay buffer, then write the arrays with h5py. Every group name and dataset path below is an illustrative choice a lab makes, not a standard for UMI, and no third-party robotics HDF5 layout is presented as one. See the sibling guides for LeRobot, RLDS and MCAP.

How do a UMI Zarr replay buffer and an HDF5 file compare?

Structural facts from the UMI repository, the HDF Group documentation and the h5py documentation. The sources read state no read speed or file size, so none is implied.
AspectUMI Zarr replay bufferHDF5 file
ContainerOne dataset.zarr.zip, written with a zip store by the script.One HDF5 file; the File object is also the root group.
StructureA root with a data group of arrays and a meta group.Groups holding datasets and other groups, with attributes on both.
NamingArray names set by the script, such as robot0_eef_pos.Names and hierarchy chosen by the application.
EpisodesConcatenated on one time axis; meta/episode_ends marks the boundaries.No episode object; a lab convention such as one group per episode.
ChunkingTime axis only; images one frame per chunk.Contiguous by default; chunked layout is optional and set with the chunks keyword in h5py.
CompressionJPEG XL codec on images; no compressor on the low-dimensional arrays.Filter pipeline on chunked data: gzip, lzf, szip, shuffle and others, plus dynamically loaded filters, per h5py.
MetadataThe script writes only meta/episode_ends.Attributes: small named values attached to groups and datasets.
TimestampsNo timestamp array written by the script.None implied; a dataset per stream is a lab choice.

Structural facts from the UMI repository, the HDF Group documentation and the h5py documentation. The sources read state no read speed or file size, so none is implied.

How do UMI arrays map to HDF5 groups and datasets?

This mapping is a proposal, not an official one. Array names are as the repo names them. The paths in the third column are illustrative choices; no source defines them. Not stated means the sources are silent.

Illustrative array-to-dataset mapping for one episode, with one group per episode. That is one reading of the buffer, not a requirement of either format.
UMI array (as the repo names it)What it holdsIllustrative HDF5 path (the lab choice)Notes
camera{j}_rgbuint8 RGB frame per step, at the output resolution the script was run with./episode_0000/camera{j}/rgbDecoding needs the repo codec. Record dtype, shape and channel order.
robot{i}_eef_posEnd-effector position, float32./episode_0000/robot{i}/eef_posUnits and frame not stated in the script; take them from your capture spec.
robot{i}_eef_rot_axis_angleRotation, axis-angle as the repo names it, float32./episode_0000/robot{i}/eef_rot_axis_angleHDF5 defines no rotation type, so keep the representation in the name.
robot{i}_gripper_widthOne float32 per step, with a trailing axis of length one./episode_0000/robot{i}/gripper_widthUnit not stated in the script; record it as an attribute.
robot{i}_demo_start_pose, robot{i}_demo_end_poseDemo start and end pose, repeated on every step by the script.Attributes on /episode_0000/robot{i}One value per episode is enough if the pose is small; attributes are read whole.
meta/episode_endsEpisode end offsets (int64).Not needed with one group per episode; /meta/episode_ends if you keep one long axis.HDF5 stores no such offsets itself.
Timestamps, IMU, task text, labelsNot in the replay buffer.Datasets per stream under the episode group; short values as attributes.Need your capture spec or raw session data. Names and rates not stated.

Illustrative array-to-dataset mapping for one episode, with one group per episode. That is one reading of the buffer, not a requirement of either format.

The UMI task config names keys such as camera0_rgb, robot0_eef_pos and robot0_gripper_width, per the replay buffer entry. If you want to reuse repo code against your HDF5 data, keep those names in your dataset names, because the sources document no HDF5 reader.

How do you keep episode boundaries and metadata?

The replay buffer has episode_ends and HDF5 has no episode concept, so the boundary is your choice. Three layouts are possible, and all three are lab decisions that no source recommends:

  • One group per episode in one file: each episode group holds its own datasets, so an episode is addressed by a path and no offsets are needed.
  • One long axis plus an offsets dataset: datasets mirror the replay buffer and an episode_ends dataset marks the boundaries, which keeps the buffer shape.
  • One file per episode: the simplest to move and delete, at the cost of many files.

By default h5py iterates the objects in a group in alphanumeric order, and with track_order=True a group remembers insertion order, per the h5py groups page (opens in a new tab). Do not rely on iteration order to mean episode order: store the episode index explicitly, as a zero-padded name or an attribute.

Put task and episode metadata, the spec reference and calibration notes where readers will look, as attributes on the episode group when they are small and as datasets when they are not. The replay buffer carries none of this: it has no task text, no episode metadata and no success or failure label, so these come from your capture spec. The UMI data annotation guide covers which labels to specify, and the UMI data collection spec guide covers writing them down.

What are the steps to convert UMI data to HDF5?

These steps are an approach assembled from the two sets of sources, not a documented UMI procedure. Write each decision in your spec first.

  • Open the replay buffer, list the arrays under data and read meta/episode_ends.
  • Slice every array into episodes with episode_ends, and check each array has the same number of steps in each episode, as the ReplayBuffer class asserts.
  • Write the layout: group names, dataset paths, data types, and which values become attributes.
  • Decide timestamps from the capture spec or raw session data, on one clock, and record the epoch.
  • Decide image storage: decoded frames inside the file, or video kept outside with a path in an attribute.
  • Choose a chunk shape and a lossless compression filter for each dataset.
  • Create the file with h5py, make groups with create_group, datasets with create_dataset and attributes with attrs.
  • Add task and episode metadata and labels as your spec defines them.
  • Reopen the file read-only and run the checks below.

No writer code is shown. Each h5py call is documented in the quick start (opens in a new tab) and the datasets page (opens in a new tab), but the replay-buffer side was not verified as a working end-to-end script for a UMI case. Test on a small batch first.

How do you store camera images?

The frames in the buffer are already reduced: resized to the output resolution, with tags inpainted and the gripper masked, and compressed per frame with a JPEG XL codec that the repo registers in its own code. Reading them needs that codec, so decode with the repo code. For more detail than the buffer holds, regenerate from the raw session videos.

Whether images should live inside the HDF5 file is not settled by any source read. The options are lab choices:

  • Decoded frames as one uint8 dataset per camera, shaped steps by height by width by three, as the buffer holds them. Simple to slice, and the file grows with the frame count.
  • Video kept outside the file, with its path and frame range stored as small attributes. The file stays small, and the link can break if files move.
  • Compressed frames through a dynamically loaded filter. The h5py docs say the HDF5 library can load filters dynamically and point to hdf5plugin, which lists Blosc, LZ4 and ZFP. They do not mention JPEG XL, so do not assume an HDF5 filter exists for the repo codec.

Give each camera its own dataset, and record dtype, shape, channel order and the resolution option used. Chunking decides how fast a single frame reads, covered next.

How do chunking and compression apply?

The HDF5 dataset chapter (opens in a new tab) lists three storage strategies for a dataset array: contiguous, chunked and compact. It says data transfer operations work the same for any storage method, though some operations can be more or less efficient depending on the strategy and access pattern. The facts below are from the h5py datasets page (opens in a new tab):

  • A dataset created with default settings is contiguous. Chunked storage divides it into regularly sized pieces, set with the chunks keyword, and it makes resizing and compression filters possible.
  • Passing compression or maxshape turns on auto-chunking even if chunks is not set.
  • The whole chunk is involved even if one element is needed, so the chunk shape should favour the reads you expect. The page suggests a chunk size between 10 KiB and 1 MiB, larger for larger datasets. Those are the h5py authors’ figures, so check them against your own frame sizes.
  • Filters on chunked data: gzip (available with every HDF5 installation, so best where portability is required; level 0 to 9, default 4), lzf (with every h5py installation, fast, low to moderate compression) and szip (not available with all installations). Shuffle may improve the compression ratio, and fletcher32 adds a checksum to detect corruption.
  • These filters are lossless. The scale-offset filter is lossy and trades precision for space, so leave it off pose and width data you want to recover exactly.
  • Datasets can be resized up to maxshape, with None for an unlimited axis, which suits appending episodes to one long axis.

The replay buffer chunks only along time, with one frame per image chunk and no compressor on the low-dimensional arrays. The sources state no speed or size benefit of copying that into HDF5, so pick chunk shapes from your read pattern and measure. Choose a filter your readers have installed: a file written with a filter the reading machine lacks cannot be read.

How do you check the converted file?

  • Reopen the file read-only and list every group and dataset; the names match the layout in your spec.
  • Each episode has the same number of steps in every dataset, and the episode lengths match those from meta/episode_ends.
  • The dtype of each dataset matches the buffer (float32 for pose and width, uint8 for images).
  • A sample of values from the start, middle and end of an episode equals the buffer values.
  • One decoded frame per camera matches the buffer frame at the same index.
  • Attributes are present, small, and carry the units, rotation representation, epoch and spec reference.
  • The timestamps, if added, are strictly increasing and cover the same interval for every stream.

A file can pass every structural check and still carry a poor trajectory, so run the UMI data quality checklist before conversion too.

What can go wrong in conversion?

  • Timestamps invented from an assumed rate make a replay look real when it is not. The script writes none and the sources read state no frame rate.
  • Reading back the wrong slice: a chunked dataset is read a whole chunk at a time per h5py, so an off-by-one in an episode range can silently mix steps from two episodes. Check the first and last step of every episode.
  • Attributes that are too large: they should be small, generally under 64k per h5py, and are read whole.
  • A chunk shape that does not match the read pattern, so reading one frame touches far more data than needed.
  • A compression filter the reader lacks, or szip, which is not available with all HDF5 installations.
  • A lossy filter on poses, which silently changes the trajectory.
  • Dropping the rotation representation: the buffer holds axis-angle, and a reader may assume another.
  • Mixed lengths across arrays in one episode. The ReplayBuffer class asserts equal first dimensions; your converter should too.
  • Treating the layout as a standard. It is your convention until you document it, and another team cannot infer it.

Zarr or HDF5: should you convert at all?

The UMI training commands in the README read the Zarr file directly through task.dataset_path, and the sources document no HDF5 reader for UMI. Converting therefore means you own the loader, or you keep the Zarr file for the UMI training code and write HDF5 as a second copy for your own tools. Convert if your stack, archive or QA tooling already reads HDF5; skip it if you only train with the repo code. The UMI sources recommend neither format.

The site’s own guidance, written for Firsthand egocentric delivery, is that zarr is the better choice for object storage and HDF5 for a single local file; see the HDF5 and zarr format page. The MCAP vs HDF5 comparison covers the other container choice. If you need an episode-of-steps training layout instead, see the RLDS and LeRobot guides.

How does Firsthand deliver custom UMI-style data?

Firsthand runs custom UMI data collection: UMI-style handheld gripper demonstrations recorded to your task spec in real homes, workplaces and factories, through our network of capture providers, on rigs we source and ship. Delivered per episode: gripper-camera video, 6-DoF end-effector trajectory, continuous gripper width, IMU, timestamps, task and episode metadata, and success and failure labels. Paired head-mounted egocentric video is available on request.

This is fast, on-demand custom UMI data collection at scale through a network of thousands of capture providers, for a consistent, recurring data flow to labs. The site lists six delivery formats on the formats index, including HDF5 and zarr, which it describes for egocentric episodes. HDF5 or UMI-compatible Zarr for UMI-style episodes is not stated, so delivery format is scoped on request, as are force/torque, tactile and gripper depth. Name the layout you want in the spec. See UMI data collection services, what UMI is and how UMI variants differ, or request a custom UMI dataset.

Firsthand is not affiliated with, endorsed by or related to the UMI authors, The HDF Group, the h5py maintainers, their institutions or any gripper or camera maker.

FAQ

How to Convert UMI Data to HDF5, answered.

01

Can UMI data be stored in HDF5?

Yes in principle, once converted. The UMI replay buffer is Zarr, and an HDF5 file holds groups, datasets and attributes, so each array and episode is mapped into a layout you choose. Neither official source documents a UMI-specific path.

02

Does UMI ship an HDF5 converter?

No converter is documented in the UMI README, which mentions Zarr only, and the HDF Group and h5py documentation do not name UMI. You implement the conversion yourself, with h5py as the writer.

03

What is an HDF5 dataset vs a group?

Per The HDF Group, a dataset is a multidimensional rectangular array of data elements and a group is analogous to a file system directory that holds datasets and other groups. In h5py, groups work like dictionaries and datasets like NumPy arrays.

04

Should images go inside the HDF5 file?

The sources read do not settle it. The replay buffer stores resized, per-frame compressed images, and an HDF5 file can hold decoded frames or point to video kept outside. Choose from how you read the data and state it in the spec.

05

Does the UMI replay buffer contain timestamps?

The script writes no timestamp array, and the sources read state no frame rate. Take timestamps from your capture spec or the raw session data and store them as their own datasets.

06

Are HDF5 compression filters lossless?

Per the h5py documentation, filters enabled with the compression keyword, such as gzip and lzf, are lossless, while the scale-offset filter is lossy. The docs give no UMI-specific guidance.

07

Can Firsthand deliver UMI-style data in HDF5?

The site documents HDF5 and zarr delivery for egocentric episodes, but not for UMI-style data, so delivery format is scoped on request. Name your format in the request.

08

Where can I get custom UMI data?

From Firsthand custom UMI data collection: UMI-style handheld gripper demonstrations recorded to your task spec, at scale through a network of thousands of capture providers. Delivery format is scoped on request.

Sources

Where is this documented?

Check it against the sample pack.

40 episodes across 4 environments, delivered in the exact schema these guides describe.