metadata
metadata
¶
Metadata for actions and observations used across the codebase.
dtype across all classes uses the zarr v3 type convention.
zarr v3 allowed dtypes are defined here https://zarr-specs.readthedocs.io/en/latest/v3/data-types/index.html
BaseMetadata
¶
Base metadata class.
Attributes:
| Name | Type | Description |
|---|---|---|
dtype |
Zarr store data type. |
|
is_numerical |
Whether the observation is numerical (float or int) or not (e.g. string or categorical). |
|
needs_normalization |
Whether the data needs normalization at runtime. |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
ObservationMetadata
¶
ObservationMetadata(raw_data_column_keys, dimension, dtype, is_numerical, needs_normalization, slice_start=None, slice_end=None)
Bases: BaseMetadata
Base observation metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
raw_data_column_keys |
List of keys in the raw dataset corresponding to the observation. |
|
dimension |
Dimension that will be used to store the observation in the zarr store. |
|
slice_start |
Optional starting index for slicing a larger stored observation vector. |
|
slice_end |
Optional ending index (exclusive) for slicing a larger stored observation vector. |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
PositionObservationMetadata
¶
PositionObservationMetadata(raw_data_column_keys, dimension, dtype, needs_normalization, frame=value, slice_start=None, slice_end=None)
Bases: ObservationMetadata
Robot position observation metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
frame |
str
|
Coordinate frame of the position observation. |
Source code in src/versatil/data/metadata.py
OrientationObservationMetadata
¶
OrientationObservationMetadata(raw_data_column_keys, dimension, dtype, needs_normalization, frame=value, orientation_representation=value, slice_start=None, slice_end=None)
Bases: ObservationMetadata
Robot orientation observation metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
frame |
Coordinate frame of the orientation observation. |
|
orientation_representation |
Representation of the orientation. |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
GripperObservationMetadata
¶
GripperObservationMetadata(raw_data_column_keys, dimension, dtype, needs_normalization, gripper_type=value, binary_gripper_range=value, slice_start=None, slice_end=None)
Bases: ObservationMetadata
Gripper state observation metadata, representing the clamps state of the gripper.
Attributes:
| Name | Type | Description |
|---|---|---|
gripper_type |
str
|
Type of gripper ('binary' or 'continuous'). |
binary_gripper_range |
str
|
Range for binary gripper ('zero_one' or 'minus_one_one'). |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
CameraMetadata
¶
Bases: BaseMetadata
Shared camera observation metadata.
Note
In the dataset schema context, image_width/image_height define storage dimensions. In the observation space context, they define training-time resize targets.
Attributes:
| Name | Type | Description |
|---|---|---|
raw_camera_key |
Key in the raw dataset corresponding to the camera.
It has to be one of |
|
channels |
Number of image channels. |
|
image_width |
Target image width. |
|
image_height |
Target image height. |
|
max_pixel_value |
Optional value used to scale image tensors after resizing and channel reordering. |
Source code in src/versatil/data/metadata.py
is_single_channel
property
¶
Whether this camera has a single channel (e.g. for depth maps).
__eq__
¶
Structural equality — compares camera identity and format, not dimensions.
Dimensions are excluded because image_height/image_width have different semantics depending on context: storage size in the dataset schema vs training resize target in the observation space.
Source code in src/versatil/data/metadata.py
RGBCameraMetadata
¶
Bases: CameraMetadata
RGB camera observation metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_key
|
str
|
Key in the raw dataset corresponding to the RGB camera. |
required |
dtype
|
str
|
Zarr storage dtype for RGB values. |
required |
image_width
|
int
|
Target image width. |
required |
image_height
|
int
|
Target image height. |
required |
max_pixel_value
|
float | None
|
Value used to scale RGB image tensors after resizing and channel reordering. |
255.0
|
Source code in src/versatil/data/metadata.py
DepthCameraMetadata
¶
Bases: CameraMetadata
Depth camera observation metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_key
|
str
|
Key in the raw dataset corresponding to the depth camera. |
required |
dtype
|
str
|
Zarr storage dtype for depth values. |
required |
image_width
|
int
|
Target image width. |
required |
image_height
|
int
|
Target image height. |
required |
max_pixel_value
|
float | None
|
Optional value used to scale depth image tensors after resizing and channel reordering. |
None
|
Source code in src/versatil/data/metadata.py
ActionMetadata
¶
ActionMetadata(prediction_dimension, is_numerical, needs_normalization, dtype, is_precomputed, requires_prediction_head=True)
Bases: BaseMetadata
Action metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
prediction_dimension |
Dimension for model prediction. May differ from storage, e.g., class labels stored as 1 column but predicted as n_classes logits. |
|
requires_prediction_head |
Whether this action requires a prediction head. Set to False for auxiliary/meta data that doesn't need prediction |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
OnTheFlyActionMetadata
¶
Bases: ActionMetadata
Metadata for computing an action on-the-fly from a stored zarr observation group.
This defines how to derive an action from stored observations at runtime.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_metadata
|
ProprioceptiveObservationMetadata
|
Metadata of the source observation used to compute the action. |
required |
computation_method
|
str
|
Method to compute the action, default 'delta' for subtraction between consecutive observations. |
value
|
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
PrecomputedActionMetadata
¶
PrecomputedActionMetadata(raw_data_column_keys, storage_dimension, prediction_dimension, is_numerical, needs_normalization, dtype, slice_start=None, slice_end=None, requires_prediction_head=True)
Bases: ActionMetadata
Precomputed action metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
raw_data_column_keys |
List of keys in the raw dataset corresponding to the action. |
|
storage_dimension |
Dimension that will be used to store the action in the zarr store. |
|
prediction_dimension |
Dimension for model prediction. May differ from storage, e.g., class labels stored as 1 column but predicted as n_classes logits. |
|
slice_start |
Optional starting index for slicing a larger stored action vector. |
|
slice_end |
Optional ending index (exclusive) for slicing a larger stored action vector. |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
PositionActionMetadata
¶
PositionActionMetadata(frame, raw_data_column_keys, storage_dimension, prediction_dimension, needs_normalization, dtype, slice_start=None, slice_end=None, computation_method=None)
Bases: PrecomputedActionMetadata
Precomputed position action metadata.
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
OrientationActionMetadata
¶
OrientationActionMetadata(frame, orientation_representation, raw_data_column_keys, storage_dimension, prediction_dimension, needs_normalization, dtype, slice_start=None, slice_end=None)
Bases: PrecomputedActionMetadata
Precomputed orientation action metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
orientation_representation |
Representation of the orientation. |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
GripperActionMetadata
¶
GripperActionMetadata(gripper_type, raw_data_column_keys, storage_dimension, prediction_dimension, needs_normalization, dtype, binary_gripper_range=value, slice_start=None, slice_end=None)
Bases: PrecomputedActionMetadata
Precomputed gripper action metadata.
This class represents gripper actions, which can be either binary (open/close) or continuous (partial open).
Attributes:
| Name | Type | Description |
|---|---|---|
gripper_type |
str
|
Type of gripper action ('binary' or 'continuous'). |
binary_gripper_range |
str
|
Range for binary gripper action ('zero_one' or 'minus_one_one'). |
Source code in src/versatil/data/metadata.py
__eq__
¶
Equality function.
Source code in src/versatil/data/metadata.py
validate_camera_metadata_keys
¶
Validate that camera metadata matches its canonical observation key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_metadata
|
Mapping[str, CameraMetadata]
|
Camera metadata indexed by canonical VersatIL camera key. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a metadata raw camera key maps to a different canonical camera key. |