1 data_handling.ase_efm.views

data_handling.ase_efm.views

Typed, zero-copy views over EFM-formatted ATEK samples.

These classes mirror the style of aria_nbv.data.views but read the keys produced by efm3d.dataset.efm_model_adaptor.load_atek_wds_dataset_as_efm. The consumed EFM key families cover ARIA_IMG/ARIA_CALIB camera streams, image/depth timestamps and frame IDs, ARIA_POSE_T_WORLD_RIG trajectories, MPS semidense point positions/uncertainties/volumes, and padded OBB/GT payloads. ATEK’s EfmModelAdaptor owns flattened-key remapping; these views only expose the resulting schema and retain the backing dictionary.

The view layer defines which fields are actor-visible (calibrated images, world-from-rig poses, and MPS semidense points) and which are oracle/evaluation assets (ARIA_OBB_PADDED, nested gt_data, and attached ASE meshes). Actor-visible EVL detected boxes enter later through backbone outputs, not EfmSnippetView.obbs. Views avoid copying large tensors so writers can attach mesh and snippet context without changing immutable VIN offline rows.

1.1 Classes

Name Description
EfmCameraView Expose one calibrated Aria camera stream view without copying EFM tensors.
EfmGTView Parse nested gt_data/efm_gt annotations for evaluation-only access.
EfmGtCameraObbView Expose per-camera ASE GT boxes for one EFM evaluation timestamp.
EfmGtTimestampView Group oracle GT OBB views for one timestamp across Aria cameras.
EfmObbView Expose snippet-level GT boxes in the EFM ObbTW layout.
EfmPointsView Expose actor-visible MPS semidense reconstruction evidence.
EfmSnippetView Own the typed boundary around one adapted ATEK/ASE snippet.
EfmTrajectoryView Expose the MPS/EFM world-from-rig trajectory for one snippet.

1.1.1 EfmCameraView

data_handling.ase_efm.views.EfmCameraView(
    images,
    calib,
    time_ns,
    frame_ids,
    distance_m=None,
    distance_time_ns=None,
)

Expose one calibrated Aria camera stream view without copying EFM tensors.

The view consumes matching entries from ARIA_IMG, ARIA_CALIB, ARIA_IMG_TIME_NS, ARIA_FRAME_ID, and optional ARIA_DISTANCE_M/ARIA_DEPTH_TIME_NS families. VRS and online calibration are upstream provenance; runtime access is through ATEK/EFM.

1.1.1.1 Attributes

Name Description
images Tensor["F C H W", float32] normalized RGB or monochrome frames.
calib Per-frame CameraTW intrinsics/extrinsics; backing shape is (F, 34).
time_ns Tensor["F", int64] Aria device-clock timestamps aligned to images.
frame_ids Tensor["F", int64\|float32] frame ids within the snippet.
distance_m Optional Tensor["F 1 H W", float32] per-pixel ray distances in metres.
distance_time_ns Optional Tensor["F", int64] timestamps for distance_m.
num_frames Return the number of frames in the camera stream.

1.1.1.2 Methods

Name Description
to Move the camera view tensors to the requested device and dtype.
get_fov Return Tensor["F 2", float32] horizontal/vertical FOV in degrees.
select_frame_indices Resolve user-provided frame indices, supporting negatives and defaults.
nearest_traj_indices Return selected camera indices and nearest trajectory indices.
1.1.1.2.1 to
data_handling.ase_efm.views.EfmCameraView.to(device, *, dtype=None)

Move the camera view tensors to the requested device and dtype.

1.1.1.2.2 get_fov
data_handling.ase_efm.views.EfmCameraView.get_fov()

Return Tensor["F 2", float32] horizontal/vertical FOV in degrees.

1.1.1.2.3 select_frame_indices
data_handling.ase_efm.views.EfmCameraView.select_frame_indices(
    frame_indices,
    *,
    default_last,
)

Resolve user-provided frame indices, supporting negatives and defaults.

1.1.1.2.4 nearest_traj_indices
data_handling.ase_efm.views.EfmCameraView.nearest_traj_indices(
    traj_ts_ns,
    frame_indices=None,
    *,
    default_last=True,
)

Return selected camera indices and nearest trajectory indices.

1.1.2 EfmGTView

data_handling.ase_efm.views.EfmGTView(raw)

Parse nested gt_data/efm_gt annotations for evaluation-only access.

1.1.2.1 Attributes

Name Description
raw Zero-copy backing GT payload from the adapted ATEK sample.
efm_gt Timestamp-indexed per-camera GT views; never actor-visible observations.
timestamps Return sorted string keys for available efm_gt timestamps.

1.1.2.2 Methods

Name Description
cameras_at Return evaluation-only per-camera GT OBBs at one timestamp.
1.1.2.2.1 cameras_at
data_handling.ase_efm.views.EfmGTView.cameras_at(ts)

Return evaluation-only per-camera GT OBBs at one timestamp.

1.1.2.2.1.1 Parameters
Name Type Description Default
ts str | int Timestamp key accepted as text or an integer. required
1.1.2.2.1.2 Returns
Name Type Description
dict[str, EfmGtCameraObbView] Camera-name mapping for the requested GT slice.

1.1.3 EfmGtCameraObbView

data_handling.ase_efm.views.EfmGtCameraObbView(
    category_names,
    category_ids,
    instance_ids,
    object_dimensions,
    ts_world_object,
)

Expose per-camera ASE GT boxes for one EFM evaluation timestamp.

These tensors are label/evaluation assets used for matching and target crops. They must not be passed to an actor as observed object detections.

1.1.3.1 Attributes

Name Description
category_names Human-readable EFM taxonomy labels aligned with the K GT box rows.
category_ids Tensor["K", int64] semantic IDs aligned with category_names.
instance_ids Tensor["K", int64] GT instance IDs shared across camera views.
object_dimensions Tensor["K 3", float32] object-frame box side lengths in metres.
ts_world_object Tensor["K 3 4", float32] world←object GT transforms per instance.

1.1.4 EfmGtTimestampView

data_handling.ase_efm.views.EfmGtTimestampView(time_id, cameras)

Group oracle GT OBB views for one timestamp across Aria cameras.

1.1.4.1 Attributes

Name Description
time_id Timestamp identifier for this GT slice.
cameras Per-camera GT OBB views keyed by camera stream name.

1.1.5 EfmObbView

data_handling.ase_efm.views.EfmObbView(obbs, hz=None)

Expose snippet-level GT boxes in the EFM ObbTW layout.

obbs may be shaped (T, K, 34), (1, K, 34), or (K, 34) depending on the source. K is padded; padded rows are all PAD_VAL and must be removed with ObbTW.get_padding_mask() before matching label targets.

The 34 payload columns are the EFM OBB contract: object-frame 3D bounds, three 2D boxes, a 12-value pose, semantic id, instance id, confidence, and movable flag. In EfmSnippetView these boxes originate from ARIA_OBB_PADDED and are GT label/evaluation data. Actor-visible target hypotheses must come from EVL predictions or tracking instead. Downstream target selection transforms the latest valid slice into world coordinates before constructing Oracle target tasks.

1.1.5.1 Attributes

Name Description
obbs Tensor["... K 34", float32] GT boxes in the source EFM frame.
hz Optional Tensor["1", int32] detection frequency.

1.1.6 EfmPointsView

data_handling.ase_efm.views.EfmPointsView(
    points_world,
    dist_std,
    inv_dist_std,
    time_ns,
    volume_min,
    volume_max,
    lengths,
)

Expose actor-visible MPS semidense reconstruction evidence.

The ARIA_POINTS_* tensors are padded per frame; lengths defines the valid prefix and non-finite rows remain invalid. Positions, uncertainties, and volume bounds preserve the EFM world frame and metric units.

1.1.6.1 Attributes

Name Description
points_world Tensor["F N_pad 3", float32] padded world-frame MPS points in metres.
dist_std Tensor["F N_pad", float32] per-point distance standard deviation in metres.
inv_dist_std Tensor["F N_pad", float32] inverse distance uncertainty in metres⁻¹.
time_ns Tensor["F", int64] timestamps aligned to point slices.
volume_min Tensor["3", float32] snippet AABB minimum in world frame, metres.
volume_max Tensor["3", float32] snippet AABB maximum in world frame, metres.
lengths Tensor["F", int64] valid point-prefix length for each padded frame.

1.1.6.2 Methods

Name Description
to Move the semidense point tensors to the requested device and dtype.
collapse_points Collapse points across time and optionally subsample.
last_frame_points_np Return points from the latest frame with valid points, subsampled if needed.
1.1.6.2.1 to
data_handling.ase_efm.views.EfmPointsView.to(device, *, dtype=None)

Move the semidense point tensors to the requested device and dtype.

1.1.6.2.2 collapse_points
data_handling.ase_efm.views.EfmPointsView.collapse_points(
    max_points=None,
    include_inv_dist_std=False,
    include_obs_count=False,
)

Collapse points across time and optionally subsample.

1.1.6.2.2.1 Parameters
Name Type Description Default
max_points int | None Optional cap on the number of returned points. None
include_inv_dist_std bool If True, append inverse depth std per point. False
include_obs_count bool If True, append the number of snippet frames that observed each point (observation count). False
1.1.6.2.2.2 Returns
Name Type Description
Tensor Tensor["K 3", float32] if no extra features are requested.
Tensor Tensor["K 4", float32] if exactly one extra feature is requested
Tensor (XYZ + inv_dist_std or XYZ + obs_count).
Tensor Tensor["K 5", float32] if both extras are requested
Tensor (XYZ + inv_dist_std + obs_count).
1.1.6.2.3 last_frame_points_np
data_handling.ase_efm.views.EfmPointsView.last_frame_points_np(max_points=None)

Return points from the latest frame with valid points, subsampled if needed.

1.1.7 EfmSnippetView

data_handling.ase_efm.views.EfmSnippetView(
    efm,
    scene_id,
    snippet_id,
    mesh=None,
    crop_bounds=None,
    mesh_verts=None,
    mesh_faces=None,
    mesh_cache_key=None,
    mesh_specs=None,
)

Own the typed boundary around one adapted ATEK/ASE snippet.

efm retains the zero-copy key/value payload produced by EfmModelAdaptor. Camera/calibration, world-from-rig trajectory, and MPS semidense fields are actor-visible observations. Attached ASE meshes, ARIA_OBB_PADDED, and nested gt_data are oracle/evaluation assets. Mesh tensors are optional CPU/cache products and are not moved into the EFM dictionary.

1.1.7.1 Attributes

Name Description
efm Zero-copy adapted ATEK payload containing the consumed ARIA_* key families.
scene_id ASE scene identifier used for shard lineage and GT-mesh pairing.
snippet_id Compact ATEK sample identifier derived from the WebDataset sample key.
mesh Optional ASE GT mesh used only by oracle labeling and evaluation.
crop_bounds Optional pair of Tensor["3", float32] world-frame bounds in metres.
mesh_verts Optional Tensor["V 3", float32] GT-mesh vertices in world frame, metres.
mesh_faces Optional Tensor["F_mesh 3", int64] triangle vertex indices.
mesh_cache_key Stable key (spec hash) for shared mesh caches across components.
mesh_specs Optional mesh processing specification used to derive attached mesh tensors.
camera_rgb RGB stream (fisheye624, 240x240 in ASE preprocessing).
camera_slam_left Left SLAM mono stream (fisheye624, ~320x240).
camera_slam_right Right SLAM mono stream (fisheye624, ~320x240).
trajectory Rig trajectory (world←rig) aligned to snippet frames.
semidense Semi-dense SLAM points (padded to fixed length).
obbs Return padded ASE GT OBBs for label/evaluation use when present.
gt Ground-truth dict gt_data (EFM OBBs per timestamp/camera).
has_mesh Return whether a ground-truth mesh is attached to the snippet.

1.1.7.2 Methods

Name Description
from_cache_efm Construct a snippet view from an offline-cache EFM dict.
get_camera Return the requested camera stream view from the backing EFM dict.
get_occupancy_extend Return [xmin, xmax, ymin, ymax, zmin, zmax] AABB in world frame.
to Return a shallow copy with EFM tensors and wrappers moved to a device.
prune_efm Return a view with the EFM dict pruned to the requested keys.
1.1.7.2.1 from_cache_efm
data_handling.ase_efm.views.EfmSnippetView.from_cache_efm(
    efm,
    *,
    mesh=None,
    crop_bounds=None,
    mesh_verts=None,
    mesh_faces=None,
    mesh_cache_key=None,
    mesh_specs=None,
)

Construct a snippet view from an offline-cache EFM dict.

1.1.7.2.1.1 Parameters
Name Type Description Default
efm dict[str, Any] Raw cache sample dict that includes "__key__". required
mesh Trimesh | None Optional GT mesh to attach. None
crop_bounds tuple[torch.Tensor, torch.Tensor] | None Optional world-space AABB override. None
mesh_verts torch.Tensor | None Optional cached mesh vertices. None
mesh_faces torch.Tensor | None Optional cached mesh faces. None
mesh_cache_key str | None Optional mesh cache key for shared caches. None
mesh_specs MeshProcessSpec | None Optional mesh processing spec. None
1.1.7.2.1.2 Returns
Name Type Description
'EfmSnippetView' Parsed EfmSnippetView instance.
1.1.7.2.2 get_camera
data_handling.ase_efm.views.EfmSnippetView.get_camera(prefix)

Return the requested camera stream view from the backing EFM dict.

1.1.7.2.3 get_occupancy_extend
data_handling.ase_efm.views.EfmSnippetView.get_occupancy_extend()

Return [xmin, xmax, ymin, ymax, zmin, zmax] AABB in world frame.

1.1.7.2.4 to
data_handling.ase_efm.views.EfmSnippetView.to(device, *, dtype=None)

Return a shallow copy with EFM tensors and wrappers moved to a device.

The backing dictionary is rebuilt without mutating this view. Plain tensors honor dtype; EFM wrappers preserve their own dtype contract. The CPU Trimesh object is shared, while cached mesh tensors and world-frame crop bounds are moved.

1.1.7.2.5 prune_efm
data_handling.ase_efm.views.EfmSnippetView.prune_efm(
    keep_keys,
    *,
    keep_prefixes=(),
)

Return a view with the EFM dict pruned to the requested keys.

1.1.7.2.5.1 Parameters
Name Type Description Default
keep_keys set[str] | None Exact EFM keys to retain. None returns self unchanged. required
keep_prefixes tuple[str, …] Optional prefixes; keys starting with any prefix are retained. ()

1.1.8 EfmTrajectoryView

data_handling.ase_efm.views.EfmTrajectoryView(
    t_world_rig,
    time_ns,
    gravity_in_world,
)

Expose the MPS/EFM world-from-rig trajectory for one snippet.

1.1.8.1 Attributes

Name Description
t_world_rig PoseTW["F 12"] world←rig transforms; translation is metres.
time_ns Tensor["F", int64] pose timestamps.
gravity_in_world Tensor["3", float32] world-frame gravity in metres per second squared.
final_pose Return the final PoseTW["12"] world←rig pose in the snippet.

1.1.8.2 Methods

Name Description
to Move the trajectory tensors to the requested device and dtype.
1.1.8.2.1 to
data_handling.ase_efm.views.EfmTrajectoryView.to(device, *, dtype=None)

Move the trajectory tensors to the requested device and dtype.

1.2 Functions

Name Description
is_efm_snippet_view_instance Return whether value behaves like an EfmSnippetView.

1.2.1 is_efm_snippet_view_instance

data_handling.ase_efm.views.is_efm_snippet_view_instance(value)

Return whether value behaves like an EfmSnippetView.

The v2 stack accepts both the local data-handling view classes and legacy view objects that expose the same public attributes.

Back to top