opentau.datasets.standard_data_format_mapping
Standard data format mapping for dataset feature names and loss types.
This module provides mappings between standard feature names used internally by OpenTau and dataset-specific feature names used in various robot learning and vision-language datasets. It also maps datasets to their appropriate loss types for training.
The standard format uses canonical names like “camera0”, “camera1”, “state”, “actions”, “prompt”, and “response”, while different datasets may use various naming conventions (e.g., “observation.images.image”, “observation.state”, “action”, “task”, etc.). These mappings enable the codebase to work with multiple datasets without requiring dataset-specific code paths.
- Key Features:
Feature name standardization: Maps dataset-specific feature names to standard format names for consistent processing across datasets.
Multi-camera support: Handles datasets with varying numbers of camera views, mapping them to standard camera0, camera1, etc. names.
Loss type specification: Maps datasets to appropriate loss functions (MSE for continuous actions, CE for discrete classification tasks).
Constants:
- DATA_FEATURES_NAME_MAPPING
Dictionary mapping dataset repository IDs to feature name dictionaries. Each inner dictionary maps standard feature names (keys) to dataset-specific feature names (values). Standard feature names include:
“camera0”, “camera1”, …: Camera/image observations
“state”: Robot state observations
“actions”: Action outputs
“prompt”: Task descriptions or prompts
“response”: Expected responses or labels
“mistake”: Mistake-polarity signal (True/1 = something went wrong); must name a per-frame column (episode-level outcomes belong on “success”); defaults to the literal “mistake” column written by annotate_mistakes.py / attach_metadata.py
“success”: Success-polarity signal (True = episode succeeded), e.g. DROID’s “is_episode_successful”. Resolved from the frame column or the per-episode metadata (including the per-episode “mean” aggregate in episodes_stats, v2.1+) and inverted into “mistake” when no mistake column exists; also drives the value-function return bins
Example
- Access feature name mapping for a dataset:
>>> mapping = DATA_FEATURES_NAME_MAPPING["lerobot/aloha_mobile_cabinet"] >>> mapping["camera0"] # Returns "observation.images.cam_right_wrist" >>> mapping["actions"] # Returns "action"
Functions
|
Return the |
|
Look up a dataset's feature-name mapping, control-mode-aware. |
- opentau.datasets.standard_data_format_mapping.feature_mapping_key(repo_id: str, control_mode: str | None) str[source]
Return the
DATA_FEATURES_NAME_MAPPINGkey for a dataset entry.Two mixture entries can share a
repo_idwhile declaring differentdata_features_name_mappingvalues — e.g. the same robot exposed ascontrol_mode="joint"(actions -> action_joint) andcontrol_mode="ee"(actions -> action_ee). Keying the global mapping byrepo_idalone makes the second registration clobber the first, so the “joint” entry would silently read the end-effector column. Disambiguating bycontrol_modelets both coexist.Returns
"<repo_id>::<control_mode>"whencontrol_modeis a real, non-empty label, and the plainrepo_idotherwise (missing / whitespace /"unknown") — so built-in defaults and single-mode datasets keep their existingrepo_idkeys.
- opentau.datasets.standard_data_format_mapping.resolve_feature_mapping(repo_id: str, control_mode: str | None = None) dict[str, str][source]
Look up a dataset’s feature-name mapping, control-mode-aware.
Prefers the precise
"<repo_id>::<control_mode>"entry and falls back to the plainrepo_identry (built-in defaults / single-mode datasets / back-compat). RaisesKeyErrorif neither is registered.