libero
libero
¶
Dataset schema for LIBERO simulation datasets (HDF5 format).
LiberoSchema
¶
Bases: Hdf5DatasetSchema
Schema for LIBERO HDF5 datasets.
LIBERO datasets have precomputed actions and store all data in HDF5 format. Each HDF5 file represents a single task with multiple demos.
Structure per demo
- actions: (T, 7) - position delta (3) + orientation delta (3) + gripper (1)
- obs/agentview_rgb: (T, 128, 128, 3)
- obs/eye_in_hand_rgb: (T, 128, 128, 3)
- obs/ee_pos: (T, 3)
- obs/ee_ori: (T, 3)
- obs/ee_states: (T, 6) - concatenation of ee_pos and ee_ori
- obs/gripper_states: (T, 2)
- obs/joint_states: (T, 7)
Initialize the LIBERO schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hdf5_paths
|
list[str]
|
List of paths to LIBERO HDF5 files. Each file is a separate task. |
required |
zarr_path
|
str
|
Path to save/load the zarr file |
required |
metadata
|
DatasetMetadata
|
Metadata to use for creating the zarr store from the raw data. |
required |
dataset_type
|
str
|
Type of dataset. Must be 'libero'. |
value
|
Source code in src/versatil/data/raw/schemas/custom/libero.py
get_demo_names
¶
Get list of demo names in the specified HDF5 file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hdf5_path
|
str
|
Path to the HDF5 file. |
required |
Source code in src/versatil/data/raw/schemas/custom/libero.py
extract_episode
¶
Extract all data from a LIBERO demo group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
demo_group
|
Group
|
h5py Group for a single episode demonstration. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, ndarray]
|
Dictionary mapping zarr keys to numpy arrays |
Source code in src/versatil/data/raw/schemas/custom/libero.py
get_language_from_filename
staticmethod
¶
Extract task language from LIBERO HDF5 filename.
LIBERO filenames follow pattern: task_name_demo.hdf5 E.g., "pick_up_the_black_bowl_demo.hdf5" -> "pick up the black bowl"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hdf5_path
|
str
|
Path to the HDF5 file. |
required |
Source code in src/versatil/data/raw/schemas/custom/libero.py
get_required_zarr_keys
¶
Get all required zarr keys based on schema configuration.
Extends base implementation to include language key when extract_language_from_filename is True.
Source code in src/versatil/data/raw/schemas/custom/libero.py
get_zarr_array_specs
¶
Get specifications for all zarr arrays to create.
Extends base implementation to include language array when extract_language_from_filename is True.