TransformedFrameData¶

class standard_e2e.data_structures.TransformedFrameData(**data)[source]¶

Bases: BaseModel

Represents a single frame data with associated metadata, transformed by Adapters. A finalized, training-ready structure, loaded by Dataset: Raw frame data -> StandardFrameData -> TransformedFrameData.

Parameters:
dataset_name¶

Name of the dataset containing this frame.

Type:

str

segment_id¶

Identifier of the sequence/segment this frame belongs to.

Type:

str

frame_id¶

Unique identifier of the frame within the segment.

Type:

int

timestamp¶

Timestamp of the frame in seconds.

Type:

float

split¶

Dataset split (e.g., train/val/test) for this frame.

Type:

str

global_position¶

World-frame position data; defaults to a zeroed position if not provided.

Type:

Trajectory | None

filename¶

Auto-generated file name of the frame npz; computed as {dataset_name}/{split}/{segment_id}_{frame_id}.npz when missing.

Type:

str | None

aux_data¶

Optional auxiliary metadata.

Type:

dict[str, Any] | None

extra_index_data¶

Optional extra indexing metadata.

Type:

dict[str, Any] | None

timestamp_diff¶

Optional time delta to adjacent frames.

Type:

float | None

modality_defaults¶

Optional default handlers used to normalize modality data.

Type:

dict[Modality, ModalityDefaults] | None

Private Attributes:
_modality_data (dict[Modality, Any]): Raw modality-specific payloads,

stored privately for compatibility with legacy code.

Use get_modality_data() to access.

set_modality_data(modality, data)[source]¶

Store payload for a given modality.

Parameters:
get_modality_data(modality, set_default=True)[source]¶

Retrieve payload for a modality, optionally normalizing via its default handler.

Parameters:
Return type:

Any

get_present_modality_keys()[source]¶

List the modalities currently stored.

Return type:

List[Modality]

to_npz(path)[source]¶

Serialize the frame (including modality data) to a compressed .npz file.

Parameters:

path (str)

from_npz(path, required_modalities=None)[source]¶

Loads a frame from .npz, optionally ensuring required modalities exist (inserting None) and applying defaults.

Parameters:
Return type:

TransformedFrameData

aux_data: Dict[str, Any] | None¶
dataset_name: str¶
extra_index_data: Dict[str, Any] | None¶
filename: str | None¶
frame_id: int¶
classmethod from_npz(path, required_modalities=None)[source]¶

Load the frame data from a .npz file.

Return type:

TransformedFrameData

Parameters:
get_modality_data(modality, set_default=True)[source]¶

Retrieve modality-specific data from the stored modality map.

Parameters:
  • modality (Modality) – The modality key used to locate the associated data.

  • set_default (bool) – If True, normalizes the raw modality data using the configured default handler for the given modality when available. If False, returns the raw modality value without normalization. Defaults to True.

Returns:

The raw or normalized modality data, or None if the modality key is not present.

Return type:

Any

get_present_modality_keys()[source]¶

Return the list of modality keys currently present in the frame data.

Returns:

The modalities for which data is stored.

Return type:

List[Modality]

global_position: Trajectory | None¶
modality_defaults: dict[Modality, ModalityDefaults] | None¶
segment_id: str¶
set_modality_data(modality, data)[source]¶

Store data associated with the given modality.

Parameters:
  • modality (Modality) – The modality identifier used as the key.

  • data (Any) – The data object to associate with the modality.

split: str¶
timestamp: float¶
timestamp_diff: float | None¶
to_npz(path)[source]¶

Serialize the frame data to a compressed NPZ file.

Parameters:

path (str) – Destination file path for the NPZ archive.