1 data_handling.vin_store.adapter
data_handling.vin_store.adapter
Canonical helpers for adapting raw EFM snippets into VIN snippet views.
This module owns the single supported transformation from EfmSnippetView to VinSnippetView: - collapse padded per-frame semidense points, - optionally cap the collapsed point count, - pad or truncate to a fixed on-disk/runtime point budget, - preserve the snippet trajectory needed by VIN models.
The adapter is actor-visible preprocessing. It does not attach oracle RRI, target matches, GT crops, or candidate labels; those belong to offline writers or rollout replay generation.
1.1 Functions
| Name | Description |
|---|---|
| build_vin_snippet_view | Build the canonical actor-visible VIN view from an adapted EFM snippet. |
| collapse_vin_points | Collapse actor-visible MPS points across snippet time for VIN input. |
| empty_vin_snippet | Return a shape-valid VIN view with no observed points or trajectory. |
| pad_vin_points | Pad or truncate VIN point rows while preserving a valid-prefix length. |
| vin_snippet_cache_config_hash | Hash source and semidense-collapse settings for VIN payload compatibility. |
1.1.1 build_vin_snippet_view
data_handling.vin_store.adapter.build_vin_snippet_view(
efm_snippet,
*,
device,
max_points,
include_inv_dist_std=True,
include_obs_count=False,
pad_points=None,
)Build the canonical actor-visible VIN view from an adapted EFM snippet.
The returned VinSnippetView owns collapsed world-frame semidense points, a valid-prefix length, and the MPS/EFM world←rig trajectory. Missing semidense or trajectory fields yield empty typed tensors; oracle assets are intentionally excluded.
1.1.2 collapse_vin_points
data_handling.vin_store.adapter.collapse_vin_points(
efm_snippet,
*,
device,
max_points,
include_inv_dist_std=True,
include_obs_count=False,
)Collapse actor-visible MPS points across snippet time for VIN input.
1.1.2.1 Returns
| Name | Type | Description |
|---|---|---|
| torch.Tensor | Tensor["K 3+C", float32] world-frame points in metres on device. |
|
| torch.Tensor | Optional columns are inverse distance uncertainty followed by | |
| torch.Tensor | observation count; no GT mesh, OBB label, or oracle reward is included. |
1.1.3 empty_vin_snippet
data_handling.vin_store.adapter.empty_vin_snippet(
device,
*,
extra_dim=1,
pad_points=None,
)Return a shape-valid VIN view with no observed points or trajectory.
points_world has logical shape Tensor["K_pad 3+C", float32] where C=extra_dim; lengths is zero and any fixed-width rows are NaN padding. This sentinel carries no GT/oracle information.
1.1.4 pad_vin_points
data_handling.vin_store.adapter.pad_vin_points(points_world, *, pad_points)Pad or truncate VIN point rows while preserving a valid-prefix length.
1.1.4.1 Returns
| Name | Type | Description |
|---|---|---|
| torch.Tensor | Tuple containing Tensor["K_pad D", float32] points with NaN tail |
|
| torch.Tensor | padding and Tensor["1", int64] valid length. Without pad_points, |
|
| tuple[torch.Tensor, torch.Tensor] | K_pad equals the input row count. |
1.1.5 vin_snippet_cache_config_hash
data_handling.vin_store.adapter.vin_snippet_cache_config_hash(
dataset_config,
include_inv_dist_std,
include_obs_count,
semidense_max_points,
pad_points,
)Hash source and semidense-collapse settings for VIN payload compatibility.