tso
tso
¶
Dataset schema for TSO surgical CSV datasets.
TSODatasetSchema
¶
TSODatasetSchema(dataset_folders, zarr_path, metadata, dataset_type=value, use_rectified_images=True, rgb_image_crops=None)
Bases: CsvDatasetSchema
Schema for TSO zarr datasets with synchronized CSV and stereo images.
These datasets can contain: - 3D cartesian position in robot and camera frames - Binary gripper state (open/close) - Optional task phase labels - Stereo camera images (left, right) with optional depth
Initialize and validate the TSO dataset schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_folders
|
list[str]
|
List of folders containing episode CSVs. |
required |
zarr_path
|
str
|
Path to save/load the zarr store. |
required |
metadata
|
DatasetMetadata
|
Metadata to use for creating the zarr store from the raw data. |
required |
dataset_type
|
str
|
Type of dataset. Must be 'tso'. |
value
|
use_rectified_images
|
bool
|
Whether to read rectified image path columns. |
True
|
rgb_image_crops
|
dict[str, dict[str, int]] | None
|
Optional per-camera Albumentations crop params. |
None
|
Source code in src/versatil/data/raw/schemas/custom/tso.py
extract_episode
¶
Extract all data from a TSO episode, optionally cropping/resizing images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
episode
|
DataFrame
|
DataFrame with episode data. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, ndarray]
|
Dictionary mapping zarr keys to numpy arrays. |