1 vin.diagnostics.plotting

vin.diagnostics.plotting

VIN plotting helpers for geometry, feature, and prediction diagnostics.

This module provides Plotly figures for candidate poses, voxel evidence, semidense projections, learned encodings, and frame-consistency checks.

1.1 Functions

Name Description
build_backbone_evidence_figures Plot sparse voxel evidence as world-space scatter plots.
build_field_slice_figures Plot XY/XZ/YZ orthogonal slices for selected channels.
build_geometry_overview_figure Plot grid bounds, reference/voxel axes, and candidate centers in one figure.
build_lff_empirical_figures Empirical distributions for LFF Fourier + MLP outputs using actual pose_vec.
build_pos_grid_linearity_figure Check linearity between voxel coordinates and pos_grid values.
build_pose_enc_pca_figure Project flattened pose encodings to a two-dimensional PCA figure.
build_pose_grid_pca_figure Project positional grid embeddings to 2D via PCA.
build_pose_grid_slices_figure Plot 2D slices of the normalized position grid (x/y/z channels).
build_pose_vec_histogram Histogram of a single pose vector component.
build_scene_field_evidence_figures Plot scene-field channels (field_in) as world-space scatter plots.
build_se3_closure_figure Check closure consistency of T_world_cam = T_world_rig_ref * T_rig_ref_cam.
build_semidense_cnn_grid_figure Visualize the projection grid maps used by the VIN v3 semidense CNN.
build_semidense_cnn_grid_maps Compute semidense grid maps that match VIN v3’s tiny-CNN inputs.
build_semidense_projection_feature_figure Visualize semidense projection feature maps for a candidate.
build_semidense_projection_feature_maps Compute semidense projection feature maps for a candidate view.
build_semidense_projection_figure Plot semidense points colored by whether they project inside the candidate view.
build_valid_fraction_figure Plot candidate centers colored by validity fraction.
build_voxel_frame_figure Plot voxel grid bounds and voxel axes in world coordinates.
build_voxel_inbounds_figure Plot candidate in-bounds ratios and normalized coordinate distributions.
build_voxel_roundtrip_figure Visualize metric residuals from a voxel-to-world-to-voxel round trip.

1.1.1 build_backbone_evidence_figures

vin.diagnostics.plotting.build_backbone_evidence_figures(
    debug,
    *,
    occ_threshold=0.5,
    max_points=40000,
)

Plot sparse voxel evidence as world-space scatter plots.

1.1.2 build_field_slice_figures

vin.diagnostics.plotting.build_field_slice_figures(
    field,
    *,
    channel_names,
    max_channels=4,
    slice_indices=None,
    title_prefix='field',
)

Plot XY/XZ/YZ orthogonal slices for selected channels.

1.1.3 build_geometry_overview_figure

vin.diagnostics.plotting.build_geometry_overview_figure(
    debug,
    *,
    snippet,
    reference_pose_world_rig,
    max_candidates=64,
    show_reference_axes=True,
    show_voxel_axes=True,
    display_rotate_yaw_cw90=False,
    show_scene_bounds=True,
    show_crop_bounds=False,
    show_frustum=False,
    frustum_camera='rgb',
    frustum_frame_indices=None,
    frustum_scale=1.0,
    show_gt_obbs=False,
    gt_timestamp=None,
    semidense_mode='off',
    max_sem_points=20000,
    show_trajectory=False,
    mark_first_last=True,
    candidate_pose_mode='ref_rig',
    candidate_poses_world_cam=None,
    candidate_color_mode='valid_fraction',
    candidate_color='#ffd966',
    candidate_colorscale='Viridis',
    candidate_color_values=None,
    candidate_color_title='value',
    candidate_frusta_indices=None,
    candidate_frusta_camera='rgb',
    candidate_frusta_frame_index=None,
    candidate_frusta_scale=0.5,
    candidate_frusta_color='#ff4d4d',
    candidate_frusta_show_axes=False,
    candidate_frusta_show_center=False,
    backbone_fields=None,
    backbone_occ_threshold=0.5,
    backbone_max_points=40000,
    backbone_colorscale='Viridis',
)

Plot grid bounds, reference/voxel axes, and candidate centers in one figure.

1.1.4 build_lff_empirical_figures

vin.diagnostics.plotting.build_lff_empirical_figures(
    pose_vec,
    pose_encoder,
    *,
    max_features=96,
    hist_bins=60,
    max_points=8000,
    log1p_counts=False,
)

Empirical distributions for LFF Fourier + MLP outputs using actual pose_vec.

1.1.5 build_pos_grid_linearity_figure

vin.diagnostics.plotting.build_pos_grid_linearity_figure(
    pos_grid,
    voxel_extent,
    *,
    max_points=50000,
)

Check linearity between voxel coordinates and pos_grid values.

1.1.6 build_pose_enc_pca_figure

vin.diagnostics.plotting.build_pose_enc_pca_figure(
    pose_enc,
    *,
    color_values=None,
    color_label='value',
    max_points=8000,
)

Project flattened pose encodings to a two-dimensional PCA figure.

1.1.7 build_pose_grid_pca_figure

vin.diagnostics.plotting.build_pose_grid_pca_figure(
    pos_grid,
    *,
    pos_proj,
    max_points=8000,
    color_by='radius',
    show_axes=True,
    axis_scale=0.5,
)

Project positional grid embeddings to 2D via PCA.

1.1.8 build_pose_grid_slices_figure

vin.diagnostics.plotting.build_pose_grid_slices_figure(pos_grid, *, axis, index)

Plot 2D slices of the normalized position grid (x/y/z channels).

1.1.9 build_pose_vec_histogram

vin.diagnostics.plotting.build_pose_vec_histogram(
    pose_vec,
    *,
    dim_index,
    num_bins=60,
    log1p_counts=False,
)

Histogram of a single pose vector component.

1.1.10 build_scene_field_evidence_figures

vin.diagnostics.plotting.build_scene_field_evidence_figures(
    debug,
    *,
    channel_names,
    occ_threshold=0.5,
    max_points=40000,
)

Plot scene-field channels (field_in) as world-space scatter plots.

1.1.11 build_se3_closure_figure

vin.diagnostics.plotting.build_se3_closure_figure(
    candidate_poses_world_cam,
    reference_pose_world_rig,
    *,
    bins=50,
    log1p_counts=False,
)

Check closure consistency of T_world_cam = T_world_rig_ref * T_rig_ref_cam.

1.1.12 build_semidense_cnn_grid_figure

vin.diagnostics.plotting.build_semidense_cnn_grid_figure(
    points_world,
    *,
    p3d_cameras,
    candidate_index,
    grid_size,
    max_points,
)

Visualize the projection grid maps used by the VIN v3 semidense CNN.

1.1.13 build_semidense_cnn_grid_maps

vin.diagnostics.plotting.build_semidense_cnn_grid_maps(
    points_world,
    *,
    p3d_cameras,
    candidate_index,
    grid_size,
    max_points,
)

Compute semidense grid maps that match VIN v3’s tiny-CNN inputs.

1.1.14 build_semidense_projection_feature_figure

vin.diagnostics.plotting.build_semidense_projection_feature_figure(
    points_world,
    *,
    p3d_cameras,
    candidate_index,
    grid_size,
    max_points,
    semidense_obs_count_max,
    semidense_inv_dist_std_min,
    semidense_inv_dist_std_p95,
)

Visualize semidense projection feature maps for a candidate.

1.1.15 build_semidense_projection_feature_maps

vin.diagnostics.plotting.build_semidense_projection_feature_maps(
    points_world,
    *,
    p3d_cameras,
    candidate_index,
    grid_size,
    max_points,
    semidense_obs_count_max,
    semidense_inv_dist_std_min,
    semidense_inv_dist_std_p95,
)

Compute semidense projection feature maps for a candidate view.

1.1.16 build_semidense_projection_figure

vin.diagnostics.plotting.build_semidense_projection_figure(
    points_world,
    *,
    p3d_cameras,
    candidate_index,
    max_points=20000,
    show_frustum=False,
    frustum_scale=None,
    frustum_color='#ff4d4d',
)

Plot semidense points colored by whether they project inside the candidate view.

1.1.17 build_valid_fraction_figure

vin.diagnostics.plotting.build_valid_fraction_figure(debug)

Plot candidate centers colored by validity fraction.

1.1.18 build_voxel_frame_figure

vin.diagnostics.plotting.build_voxel_frame_figure(debug, *, axis_scale=0.5)

Plot voxel grid bounds and voxel axes in world coordinates.

1.1.19 build_voxel_inbounds_figure

vin.diagnostics.plotting.build_voxel_inbounds_figure(
    candidate_poses_world_cam,
    t_world_voxel,
    voxel_extent,
    *,
    bins=50,
)

Plot candidate in-bounds ratios and normalized coordinate distributions.

1.1.20 build_voxel_roundtrip_figure

vin.diagnostics.plotting.build_voxel_roundtrip_figure(
    debug,
    *,
    num_points=2000,
    log1p_counts=False,
)

Visualize metric residuals from a voxel-to-world-to-voxel round trip.

Back to top