Guide
How to Convert UMI Data to RLDS Format
Short answer
The UMI repository writes a Zarr replay buffer, dataset.zarr.zip, with per-step arrays and episode_ends. RLDS stores a dataset of episodes, each holding a nested dataset of steps with flags such as is_first and is_last. Converting means cutting the arrays by episode and writing each step. Neither official source documents a UMI-to-RLDS converter.
Last reviewed:
What does the UMI pipeline output?
The official UMI repository (opens in a new tab) documents one training format. After the SLAM stage, its README runs scripts_slam_pipeline/07_generate_replay_buffer.py with an output path ending in dataset.zarr.zip, and the training command points task.dataset_path at that file. The README also links a processed Zarr dataset for the authors in-the-wild cup arrangement task. The UMI Zarr replay buffer entry is the definition; this guide treats the file as the source side of a mapping.
The ReplayBuffer class in the repo asserts that the root has a data group and a meta group, that meta holds an episode_ends array, and that every array in data has a first dimension equal to the last value of episode_ends. The layout is therefore flat: all episodes are concatenated along the first axis of every array, and episode_ends records where each one stops. The loader, UmiDataset, opens the zip file with zarr.ZipStore in read mode.
For each gripper i the script writes robot{i}_eef_pos, robot{i}_eef_rot_axis_angle, robot{i}_gripper_width, robot{i}_demo_start_pose and robot{i}_demo_end_pose, and for each camera j it writes camera{j}_rgb. The position, rotation and width arrays are cast to float32. The script writes no action array, no IMU array, no timestamp array, no task text, no reward and no success or failure labels, so none of those exist in the replay buffer as the repo produces it.
Images are not the original video. The script decodes each demo video, resizes the frames to an output resolution set by one of its options (default 224,224) and stores uint8 RGB frames, one frame per chunk, with a JPEG XL codec that the repo registers itself. The UMI paper (opens in a new tab) describes a handheld gripper with a wrist-mounted fisheye camera and recovers the end-effector pose with visual-inertial tracking, which is why the pose arrays hold post-processed values and not robot readings.
What does the RLDS format expect?
The official RLDS repository (opens in a new tab) says RLDS stands for Reinforcement Learning Datasets, an ecosystem of tools to store, retrieve and manipulate episodic data for sequential decision making, including learning from demonstrations and imitation learning. A dataset is retrieved as a tf.data.Dataset of episodes, where each episode contains a tf.data.Dataset of steps. The RLDS paper (opens in a new tab) describes the same nesting and says the format is designed to be lossless, uniform and flexible.
- Episode: a dictionary holding a dataset of steps plus metadata. Metadata fields are user-defined; the README proposes optional episode_id, agent_id, environment_config, experiment_id and invalid.
- Mandatory step fields, per the README: is_first and is_last.
- Optional step fields, per the README: observation, action, reward, is_terminal, discount and extra metadata.
- Consistency rule, per the README: although some step fields are optional, all steps in the same dataset must have the same fields.
- Flexibility, per the paper: no limit on the shape or type of the data fields, so observations can include images or nested dictionaries, and custom information can be stored at dataset, episode or step level.
The README adds two rules that matter for conversion. In a step where is_last is true, the step holds the last observation, and action, reward, discount and other custom fields after the observation are considered invalid. And the paper states that RLDS stores steps in what it calls SAR alignment (state, action, reward), so a step pairs an observation with the action applied to it.
Is there an official UMI-to-RLDS converter?
Not in the sources read. The UMI README mentions Zarr only; it names no RLDS, LeRobot or MCAP output and documents no converter. The RLDS README and paper describe tools to create datasets (EnvLogger for synthetic data, RLDS Creator for human interaction with an environment) and a route to add other datasets to TFDS, and neither names UMI. The same reading is recorded in UMI dataset formats.
What the RLDS sources do say is that datasets not created with their tools can still be read as RLDS, for example by adding them to TFDS, provided the result has an RLDS-compatible format. The paper adds that a user adding a dataset to TFDS provides a Python class that reads from the raw data and produces an RLDS dataset. So conversion is an approach a lab implements itself, and nothing on this page is an official UMI or RLDS tool. The Firsthand site also has converting RLDS to LeRobot for the opposite direction, written for the Firsthand egocentric schema, not for UMI.
How do a UMI Zarr replay buffer and an RLDS dataset compare?
| Aspect | UMI Zarr replay buffer | RLDS dataset |
|---|---|---|
| Top-level structure | A Zarr root with a data group of arrays and a meta group with episode_ends. | A dataset of episodes; each episode holds a nested dataset of steps and metadata. |
| Episode boundaries | meta/episode_ends, an int64 array; every array in data has a first dimension equal to its last value. | Explicit episode objects, plus is_first and is_last flags on steps. |
| Step content | Named arrays: robot{i}_eef_pos, robot{i}_eef_rot_axis_angle, robot{i}_gripper_width, demo start and end poses, camera{j}_rgb. | observation, action, reward, discount, is_first, is_last, is_terminal and custom metadata. |
| Action | No action array in the buffer. The repo sampler concatenates eef_pos, eef_rot_axis_angle and gripper_width per robot to form one. | Optional action field: the action applied to the current observation. |
| Reward and terminal flags | None written by the script. | Optional reward, discount and is_terminal; mandatory is_first and is_last. |
| Images | uint8 RGB arrays at the script output resolution, compressed with a JPEG XL codec the repo registers. | Observations can include images; the sources read state no image encoding or size. |
Structural facts from the UMI repository, the RLDS README and the RLDS paper. No read speed, file size or compression figure is stated by the sources, so none is implied.
How do UMI arrays map to RLDS steps?
| UMI array (as the repo names it) | What it holds | RLDS step or episode field | Notes |
|---|---|---|---|
| camera{j}_rgb | uint8 RGB frames from gripper camera j, one per step, at the script output resolution (default 224,224). | A key inside observation, for example a nested dictionary entry per camera. | Key names are your choice. RLDS prescribes none; image encoding in the stored dataset is not stated. |
| robot{i}_eef_pos | End-effector position, three float32 values per step. | Inside observation, inside action, or both. | The UMI sampler builds its action from this array. Placement under RLDS: not stated. |
| robot{i}_eef_rot_axis_angle | End-effector rotation as axis-angle, three float32 values per step. | Inside observation, inside action, or both. | The UMI task config uses a 6D rotation representation at training time. RLDS states no rotation representation. |
| robot{i}_gripper_width | Gripper width, one float32 value per step. | Inside observation, inside action, or both. | Placement: not stated. |
| robot{i}_demo_start_pose, robot{i}_demo_end_pose | The start and end pose of the demo, repeated on every step of the episode. | Episode metadata, or custom step metadata. | RLDS allows custom metadata at episode and step level. Repeating a constant on each step is a choice, not a requirement. |
| meta/episode_ends | Where each episode ends in the concatenated arrays (int64). | The boundary between RLDS episodes; is_first and is_last on steps. | Used to cut the arrays. RLDS does not store offsets. |
| Action (no array) | Not stored in the replay buffer. The repo sampler concatenates eef_pos, eef_rot_axis_angle and gripper_width. | action | RLDS action is the action applied to the current observation. Which UMI values form it, and at which time offset, is your decision. |
| Reward, discount | Not written by the UMI script. | reward, discount (optional) | No UMI definition. See the reward section below. |
| Timestamps, IMU, task text, success and failure labels | Not in the replay buffer as the repo produces it. | Custom step or episode metadata | Needs your capture spec or the raw session data. Names are not stated by the sources. |
A proposed mapping, not an official one. Not stated means neither the UMI repository nor the RLDS sources say how the field should be placed.
The sources read here do not describe Open X-Embodiment, so this guide claims nothing about its step keys, image sizes or action layout. Take those from your target pipeline documentation and rename the mapping above to match.
How do you mark episode boundaries, rewards and terminal steps?
Episode boundaries are the easy part. The repo asserts that the last value of episode_ends equals the array length, which implies the values are end offsets and the first episode starts at zero; confirm that on your file. For each episode, set is_first on its first step and is_last on its last step. The README says the last step holds the last observation and its action, reward and discount are invalid, so decide what your writer puts there rather than reusing the previous values silently.
Reward is a judgement call. The UMI sources define no reward, and the script writes none. In RLDS, reward is optional, and the paper notes that in imitation learning the reward is not specified. If you include a reward field, every step in the dataset must carry it, and any value you pick is your own convention that should be written down. If your pipeline does not need one, omitting the optional field is consistent with the README. Discount follows the same logic.
is_terminal needs care. The paper defines it as whether the environment considered the step terminal, and notes that a time limit can end a trajectory (is_last true) before a terminal state (is_terminal false). The README says an episode ending on a step with is_terminal false has been truncated. UMI demonstrations are recorded with a handheld gripper and no environment, so the sources do not say how a demo end should be flagged. Setting is_terminal is a modelling choice, and it is not a success label: success and failure need their own agreed field, as the site already states in UMI dataset formats.
What are the steps to convert UMI data to RLDS?
These steps are an approach assembled from the two sets of sources. They are not a documented UMI procedure, so treat each as a decision to write down in your spec before you run anything.
- Open the replay buffer. List the arrays under data, read meta/episode_ends, and confirm the first dimension of every array matches its last value, as the repo itself asserts.
- Cut into episodes. Use episode_ends to slice every array into per-episode ranges, so each episode has the same step count in every array.
- Define observation. Decide which UMI arrays go in it, how each camera is keyed, and record dtype, shape and ordering in your spec.
- Define action. The buffer has none; decide which values form it and at which time offset against the observation, since RLDS pairs an observation with the action applied to it.
- Decide the optional fields. Choose whether to include reward, discount and is_terminal, and fix the same set of fields for every step in the dataset.
- Set the flags. Put is_first on the first step and is_last on the last step of each episode, and apply your rule for is_terminal.
- Add metadata. Attach an episode ID, the task description and any labels at episode level, and timestamps at step level, from your capture spec.
- Write the dataset. The RLDS paper describes adding a dataset to TFDS through a Python class that reads the raw data and produces an RLDS dataset, with the list of fields and shapes specified. Follow the TFDS documentation for your version.
- Check. Load the dataset, compare counts with the replay buffer and inspect the first and last step of an episode.
# Load a dataset created with EnvLogger and the TFDS backend
tfds.builder_from_directory('path').as_dataset(split='all')
# Flatten episodes into a dataset of steps
step_dataset = episode_dataset.flat_map(lambda x: x[rlds.STEPS])No writer code is shown because the sources read do not give one for this case. The README says the TFDS route is only necessary when your dataset is not already in TFDS format or you want it in the TFDS catalog, and the paper says the TFDS base is built for data in the EnvLogger format; for any other raw layout, you write the reading side yourself.
How do you handle camera images?
UMI stores per-step frames inside a Zarr array, compressed with a JPEG XL codec the repo registers. Reading the array needs that codec, so register it or use the repo code to decode. The decoded frames are uint8 arrays with height, width and three channels, at the output resolution the script was run with (default 224,224). The replay buffer is therefore already a reduced version of the recording: the script also inpaints tags and masks the gripper before resizing.
On the RLDS side the sources say observations can include images and that the format puts no limit on field shape or type, but they state no image encoding, size or key name. Choose an encoding and size per your training pipeline and TFDS version, record it in the spec, and test on a small batch before converting everything. If you need a resolution other than the script output, the option that sets it is the place to change it, followed by regenerating the buffer.
How do you check the converted dataset?
- Episode count: entries in meta/episode_ends against episodes when you iterate the RLDS dataset.
- Steps per episode: differences between consecutive episode_ends values against step counts.
- Flags: is_first true only on the first step and is_last only on the last step of each episode.
- Field set: every step has the same fields, as the README requires.
- Values: spot-check eef_pos and gripper_width against the matching entries, allowing for any time offset you chose.
A converted dataset can pass every structural check and still carry a poor trajectory: conversion does not repair tracking loss or an uncalibrated gripper width. Those are upstream checks in the UMI data quality checklist. Run both: quality before conversion, structure after.
What can go wrong in conversion?
- Action alignment. RLDS pairs an observation with the action applied to it, and the paper notes that EnvLogger generates data in a shifted order that RLDS loads in SAR alignment. If you build actions from the next pose, check which step each action sits on, and remember the last step action is invalid.
- Treating is_terminal as success. It describes the environment view of the step, not task outcome.
RLDS or LeRobot: which target should you convert to?
Pick the format your training code reads. RLDS is built on tf.data and TFDS per the paper, and is described by its README as an ecosystem for episodic data in imitation learning and learning from demonstrations. The LeRobot format page on this site describes Parquet plus one MP4 per camera, and the UMI-to-LeRobot guide maps the same replay buffer onto that layout. The RLDS vs LeRobot comparison covers the training-format side of the choice.
If your stack is TensorFlow-based or expects episodes of steps with is_first and is_last flags, RLDS is the natural target; if your stack reads Parquet and MP4, LeRobot is. The UMI sources recommend neither. For a dataset you buy instead of convert, name the format in the spec so conversion is the provider job; see UMI dataset formats for the wider comparison including MCAP.
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: RLDS, LeRobot, WebDataset, HDF5 and zarr, Rerun .rrd and the episode schema. The RLDS format page describes TFDS-compatible shards for Firsthand egocentric episodes. Whether UMI-style episodes are delivered in RLDS, a UMI-compatible Zarr layout or another listed format is not stated on the site for UMI, so delivery format is scoped on request. Force/torque, tactile and gripper depth are scoped on request too. Details are on UMI data collection services; see also what UMI is and how UMI variants differ. To start, request a custom UMI dataset.
Firsthand is not affiliated with, endorsed by or related to the UMI authors, the RLDS maintainers or Google, their institutions or any gripper or camera maker.
Related
- How to convert UMI data to LeRobot format
- UMI dataset formats: Zarr, LeRobot, RLDS and MCAP
- What is the UMI Zarr replay buffer?
- RLDS delivery format
- How to convert UMI data to MCAP
- UMI data collection services
- What Is the Universal Manipulation Interface (UMI)?
- UMI variants compared: FastUMI, DexUMI, UMI-FT, TacUMI, UMI on Legs and HiFi-UMI
- Request a custom UMI dataset
FAQ
How to Convert UMI Data to RLDS Format, answered.
01Can UMI data be used in RLDS pipelines?
Yes in principle, once it is converted. The UMI replay buffer is Zarr and RLDS is a dataset of episodes with nested steps read through tf.data and TFDS, so the arrays have to be cut by episode and written as steps. Neither official source documents a UMI-specific path.
02Does UMI ship an RLDS converter?
No converter is documented in the UMI README, which mentions Zarr only, and the RLDS README and paper do not name UMI. A UMI conversion is something you implement.
03What is an RLDS step?
One entry in an episode. Per the RLDS README, a step is a dictionary with mandatory is_first and is_last fields and optional observation, action, reward, is_terminal, discount and extra metadata. All steps in the same dataset must have the same fields.
04What reward should a UMI demonstration get in RLDS?
The UMI sources define no reward, and the replay-buffer script writes none. RLDS makes reward optional. If you include it, every step needs it and the value is your own convention; if you do not need it, omit it and record that choice.
05Can Firsthand deliver UMI-style data in RLDS format?
The site lists RLDS among its delivery formats, for egocentric episodes, but does not state an RLDS or UMI-compatible Zarr layout for UMI-style data, so delivery format is scoped on request. Name your format in the request.
06Where can I get custom UMI data?
Through Firsthand custom UMI data collection: UMI-style handheld gripper demonstrations recorded to your task spec, delivered per episode, at scale through a network of thousands of capture providers. Delivery format is scoped on request.
Sources
Where is this documented?
- UMI code (GitHub) (opens in a new tab)Source for the README commands, the replay-buffer script, the ReplayBuffer class, UmiDataset, the sampler and the task config. github.com
- UMI paper (arXiv 2402.10329) (opens in a new tab)Source for the wrist-mounted fisheye camera and the visual-inertial tracking of the end-effector pose. arxiv.org
- RLDS (official GitHub repository) (opens in a new tab)Source for the episode and step format, the mandatory and optional step fields, the consistency rule, dataset creation tools and the TFDS loading calls. github.com
- RLDS paper (arXiv 2111.02767) (opens in a new tab)Source for the lossless, uniform and flexible design, the step flags, the SAR alignment and adding a dataset to TFDS. arxiv.org
Check it against the sample pack.
40 episodes across 4 environments, delivered in the exact schema these guides describe.