1 data_handling.vin_store.batch
data_handling.vin_store.batch
Shared VIN oracle batch records, masking, and collation utilities.
This module owns the training-facing boundary between actor-visible EFM/EVL state and GT-mesh-derived candidate supervision. It provides compact OBB and trajectory records plus VinOracleBatch, whose candidate axis is prefix-masked and whose collation keeps poses, cameras, RRI, and metric fields aligned.
1.1 Classes
| Name | Description |
|---|---|
| CompactObbBlock | Collatable numeric OBB payload used by training and diagnostics. |
| CompactTrajectoryBlock | Preserve MPS/EFM timing and gravity metadata beside VIN trajectory poses. |
| VinOracleBatch | Single-snippet VIN training batch produced from an oracle label run. |
| VinOracleDatasetBase | Shared interface for datasets that yield VinOracleBatch. |
1.1.1 CompactObbBlock
data_handling.vin_store.batch.CompactObbBlock(
obbs,
sem_id_to_name=None,
probs=None,
)Collatable numeric OBB payload used by training and diagnostics.
obbs keeps the raw EFM ObbTW backing layout, not a simplified center size representation. The shape is (..., K, 34), where K is a padded box slot count. Valid boxes must be determined through ObbTW(obbs).get_padding_mask().
The last dimension follows the EFM layout:
0:6: object-frame 3D bounds[xmin, xmax, ymin, ymax, zmin, zmax];6:10,10:14,14:18: RGB, SLAM-left, and SLAM-right 2D boxes;18:30:PoseTWobject-to-world/object-to-snippet transform payload;30,31,32,33: semantic id, instance id, confidence, movable.
The tensor is stored as float32 even for id-like columns; use ObbTW properties such as sem_id, inst_id, prob, bb3_center_world, and bb3_diagonal when interpreting rows. The container is boundary-neutral: VinOracleBatch.gt_obbs is oracle/evaluation data, while VinOracleBatch.detected_obbs is actor-visible EVL evidence.
1.1.1.1 Attributes
| Name | Description |
|---|---|
| obbs | Tensor["... K 34", float32] padded boxes in the EFM ObbTW layout. |
| sem_id_to_name | Optional sparse semantic id to class-name map. |
| probs | Optional Tensor["... K C", float32] class probabilities aligned to box rows. |
1.1.2 CompactTrajectoryBlock
data_handling.vin_store.batch.CompactTrajectoryBlock(
time_ns=None,
gravity_in_world=None,
)Preserve MPS/EFM timing and gravity metadata beside VIN trajectory poses.
1.1.2.1 Attributes
| Name | Description |
|---|---|
| time_ns | Optional Tensor["F", int64] Aria device-clock pose timestamps. |
| gravity_in_world | Optional Tensor["3", float32] world-frame gravity in metres per second squared. |
1.1.3 VinOracleBatch
data_handling.vin_store.batch.VinOracleBatch(
efm_snippet_view,
candidate_poses_world_cam,
reference_pose_world_rig,
rri,
pm_dist_before,
pm_dist_after,
pm_acc_before,
pm_comp_before,
pm_acc_after,
pm_comp_after,
scene_id,
snippet_id,
p3d_cameras,
candidate_count=None,
backbone_out=None,
gt_obbs=None,
detected_obbs=None,
trajectory=None,
)Single-snippet VIN training batch produced from an oracle label run.
1.1.3.1 Attributes
| Name | Type | Description |
|---|---|---|
| efm_snippet_view | EfmSnippetView | VinSnippetView | None | EFM snippet view or minimal VIN snippet (None when loading from cache). |
| candidate_poses_world_cam | PoseTW |
PoseTW["N 12"] or PoseTW["B N 12"] candidate poses as world←camera. |
| reference_pose_world_rig | PoseTW |
PoseTW["12"] or PoseTW["B 12"] reference pose as world←rig_reference. |
| rri | Tensor | Tensor["N", float32] or Tensor["B N", float32] oracle RRI per candidate. |
| pm_dist_before | Tensor | Tensor["N", float32] or Tensor["B N", float32] pre-view bidirectional error in square metres (broadcasted). |
| pm_dist_after | Tensor | Tensor["N", float32] or Tensor["B N", float32] post-view bidirectional error in square metres (per candidate). |
| pm_acc_before | Tensor | Tensor["N", float32] or Tensor["B N", float32] pre-view point-to-mesh error in square metres. |
| pm_comp_before | Tensor | Tensor["N", float32] or Tensor["B N", float32] pre-view mesh-to-point error in square metres. |
| pm_acc_after | Tensor | Tensor["N", float32] or Tensor["B N", float32] post-view point-to-mesh error in square metres. |
| pm_comp_after | Tensor | Tensor["N", float32] or Tensor["B N", float32] post-view mesh-to-point error in square metres. |
| p3d_cameras | PerspectiveCameras |
Actor-visible candidate calibration and world-to-view transforms, aligned with candidates. |
| candidate_count | Tensor | None | Number of valid candidates (scalar or batched vector). When absent, runtime code falls back to the full candidate width. |
| scene_id | str | list[str] | ASE scene id for diagnostics (string or list when batched). |
| snippet_id | str | list[str] | Snippet id (tar key/url stem) for diagnostics (string or list when batched). |
| backbone_out | EvlBackboneOutput | None | Optional cached EVL backbone outputs. |
Actor-visible inputs are the snippet view, candidate poses and PyTorch3D calibration/transforms, EVL backbone output, detected OBBs, and trajectory metadata. Candidate RRI/distance fields, mesh-derived renders, and GT OBBs are supervision/evaluation assets. candidate_count defines the valid prefix; padded candidates must be masked rather than interpreted as low-quality actions.
1.1.3.2 Methods
| Name | Description |
|---|---|
| resolved_candidate_count | Return clamped valid-prefix lengths as Tensor["", int64] or Tensor["B", int64]. |
| candidate_valid_mask | Return Tensor["N", bool] or Tensor["B N", bool] valid-prefix masks. |
| shuffle_candidates | Return a copy with candidate ordering randomly permuted. |
| collate | Collate cached VIN batches by padding candidate sets to a shared length. |
1.1.3.2.1 resolved_candidate_count
data_handling.vin_store.batch.VinOracleBatch.resolved_candidate_count(
device=None,
)Return clamped valid-prefix lengths as Tensor["", int64] or Tensor["B", int64].
1.1.3.2.2 candidate_valid_mask
data_handling.vin_store.batch.VinOracleBatch.candidate_valid_mask(device=None)Return Tensor["N", bool] or Tensor["B N", bool] valid-prefix masks.
1.1.3.2.3 shuffle_candidates
data_handling.vin_store.batch.VinOracleBatch.shuffle_candidates(generator=None)Return a copy with candidate ordering randomly permuted.
The permutation is applied consistently across candidate-specific fields: poses, oracle RRI targets, per-metric distances, and the corresponding PyTorch3D cameras. Non-candidate fields (snippet view, backbone outputs) are preserved.
1.1.3.2.4 collate
data_handling.vin_store.batch.VinOracleBatch.collate(samples)Collate cached VIN batches by padding candidate sets to a shared length.
Additional attribute identifiers: detected_obbs, gt_obbs, trajectory
1.1.4 VinOracleDatasetBase
data_handling.vin_store.batch.VinOracleDatasetBase()Shared interface for datasets that yield VinOracleBatch.
1.1.4.1 Attributes
| Name | Description |
|---|---|
| is_map_style | Whether the dataset is map-style (supports random access + batching). |