py123d_detection.torch.visualize.bev

A bird’s-eye view of one frame: what the model found, over what was there.

Reads one line of a predictions file. No checkpoint, no GPU, no 123D logs.

The drawing follows the convention the thesis used, so figures from the two are comparable:

  • Forward is up, left is left. The plot axes are (ego y, ego x) with x inverted.

  • Ground truth is filled orange, predictions are hollow blue outlines on top. Filled against hollow separates them at a glance; colour alone does not, at a thumbnail size.

  • Confidence shades the outline, from light grey at 0 to full blue at 1. A faint box is one the model was unsure of.

  • Range rings at 10, 25 and 50 m, and a tick from each box’s centre to its leading edge for heading.

Boxes whose centre falls outside the window are dropped rather than clipped, so a box at the edge is a box that is really there.

Module Attributes

TRUTH_COLOUR

Ground truth: filled, warm.

SCORE_THRESHOLD

Default score below which a prediction is not drawn.

RANGE

Half-extent of the view in metres, forward and sideways.

EGO_LENGTH

The ego vehicle's drawn footprint.

Functions

render_bev(frame[, class_names, ...])

Draw one frame's ground truth and predictions from above.

save_bev(frame, path, **kwargs)

Render one frame straight to a file, closing the figure so a long loop does not leak.

py123d_detection.torch.visualize.bev.TRUTH_COLOUR = 'darkorange'

Ground truth: filled, warm. Predictions: hollow, cool, shaded by confidence towards grey.

py123d_detection.torch.visualize.bev.SCORE_THRESHOLD = 0.3

Default score below which a prediction is not drawn. A detector emits one box per query, 900 for the shipped configs, so an unfiltered view is a solid block and shows nothing.

py123d_detection.torch.visualize.bev.RANGE = 50.0

Half-extent of the view in metres, forward and sideways.

py123d_detection.torch.visualize.bev.EGO_LENGTH = 4.5

The ego vehicle’s drawn footprint.

py123d_detection.torch.visualize.bev.render_bev(frame, class_names=None, score_threshold=SCORE_THRESHOLD, radius=RANGE, line_width=1.5, ax=None, legend=True, title=True)[source]

Draw one frame’s ground truth and predictions from above.

Parameters:
  • class_names (Optional[Sequence[str]]) – Named in the title when given; otherwise the title omits classes.

  • score_threshold (float) – Predictions below this are left out, and the title says how many.

  • radius (float) – Half-extent of the view in metres, forward and sideways.

  • ax (Any) – Draw into this axis instead of making a figure.

Returns:

the matplotlib Figure the axis belongs to.

py123d_detection.torch.visualize.bev.save_bev(frame, path, **kwargs)[source]

Render one frame straight to a file, closing the figure so a long loop does not leak.

Return type:

None