py123d_detection.torch.visualize.frame

One frame as two panels: the front camera, and the bird’s-eye view beside it.

This is the figure the thesis used to report qualitative results, and the most useful single picture of a detector. The camera panel says what the model was looking at; the BEV panel says where it put the box. A miss that is invisible in the image and a miss that is plainly visible look identical in a metric and nothing alike here.

Both panels share one colour scheme: ground truth orange, predictions blue shaded towards grey by confidence.

Functions

render_frame(image, imu2img, frame, predictions)

Camera on the left, bird's-eye view on the right.

save_frame(path, *args, **kwargs)

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

py123d_detection.torch.visualize.frame.render_frame(image, imu2img, frame, predictions, ground_truth=None, class_names=None, score_threshold=SCORE_THRESHOLD, radius=50.0, camera_name='front', height=4.5)[source]

Camera on the left, bird’s-eye view on the right.

Parameters:
  • image (ndarray) – The camera image, RGB.

  • imu2img (ndarray) – That camera’s projection, as the dataset supplies it.

  • frame (FramePrediction) – The record the bird’s-eye view is drawn from; it holds global-frame boxes.

  • predictions (ndarray) – The same predictions in the ego frame, which is what projects onto the image. Passed separately rather than derived here because the caller already has them.

  • ground_truth (Optional[ndarray]) – Ego-frame ground truth, drawn on the camera panel when given.

Return type:

Any

Returns:

the matplotlib Figure.

py123d_detection.torch.visualize.frame.save_frame(path, *args, **kwargs)[source]

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

Return type:

None