Looking at what the model found¶
An evaluation gives you one number per dataset. These views show where it came from.

The figures here come from one predictions.jsonl, a PETR checkpoint scored on two nuScenes
validation scenes. It was trained on a single vehicle class, so nothing else is boxed.
Everything reads the predictions.jsonl that py123det-eval writes beside each dataset’s metrics,
so none of it needs a checkpoint or a GPU. Install the extra first:
pip install -e "py123d_detection[viz]"
From above¶
py123det-viz bev work_dirs/petr_nuscenes_10cls/eval/nuscenes/predictions.jsonl -o frames/

Ground truth is filled orange, predictions are hollow blue, and a prediction fades to grey as its score drops. Filled against hollow still reads at thumbnail size where colour alone does not.
The layout is the thesis’s so the two are comparable. Forward is up, range rings sit at 10, 25 and 50 m, and a tick runs from each box’s centre to its leading edge for heading. A box whose centre leaves the window is dropped rather than clipped.
This needs nothing but the file. The boxes in it are global and the view puts them back into the ego frame.
|
default 0.3. A detector emits one box per query, 900 in the shipped configs, so an unfiltered view is a solid block. |
|
frames to render, default 20. |
|
only frames of one dataset, for a file covering several. |
|
half-width of the view in metres, default 50. |
|
name classes in the legend. The config group |
The front camera beside it¶
py123det-viz frame .../predictions.jsonl -o frames/ --experiment nuscenes_av2_wod

--camera picks another camera of the rig. 0, the default, is the front one in every rig.
On every camera image¶
py123det-viz cameras .../predictions.jsonl -o frames/ --experiment nuscenes_av2_wod

Use this instead of frame when the interesting object is not in front.
These need the 123D logs too, since the file holds boxes and not pixels. --experiment says
which dataset to take them from. For a config that does not live in the package, point Hydra at it
with -O 'hydra.searchpath=[file:///path/to/conf]'.
An edge is drawn only where both of its corners project in front of the camera and inside the frame, so a box leaving the view comes out partly drawn.
In the interactive viewer¶
py123det-view work_dirs/petr_nuscenes_10cls/eval/nuscenes/predictions.jsonl --split nuscenes_val

The blue wireframes are the model’s boxes. The rest is py123d’s viewer, and the controls for ours are under Predictions in the panel.
|
123D split to find the logs in, |
|
123D root holding |
|
the stride the run was evaluated with, which is what its frame numbers mean. Default is every frame, and a mismatch puts the boxes on the wrong ones. |
|
where the score slider starts, default 0.3. |
|
draw the run’s filtered ground truth as well. |
|
open at most this many logs. |
|
only frames of one dataset. |
|
default |
tools/capture_viewer.py takes the same arguments and writes two PNGs, one with the ground truth
overlay and one without, so a pair can be compared:
python tools/capture_viewer.py .../predictions.jsonl --split nuscenes_val -o docs/images
From Python¶
The rendering is ordinary functions, so a notebook or a script can use them directly:
from py123d_detection.torch.predictions import read_predictions
from py123d_detection.torch.visualize import render_bev, render_camera
for frame in read_predictions("eval/nuscenes/predictions.jsonl"):
figure = render_bev(frame, score_threshold=0.4)
...
render_camera(image, imu2img, predictions, ground_truth=..., scores=...) draws onto one camera
image and returns a new array. tile lays a rig’s cameras out in a grid, padding rather than
assuming they share a resolution, because Argoverse 2’s do not.
The conversion into py123d’s own types is public too:
from py123d_detection.core.taxonomy import get_taxonomy
from py123d_detection.torch.visualize import add_to_viser, frames_by_token, tokens_in_order, to_detections
taxonomy = get_taxonomy("general_3cls")
frames = frames_by_token("eval/nuscenes/predictions.jsonl")
# As py123d's own type, for anything in its visualisation stack:
detections = to_detections(frames["<scene uuid>:118"], taxonomy, score_threshold=0.4)
# Or straight onto a running viser server, as a wireframe overlay:
handle = add_to_viser(server, frames["<scene uuid>:118"], score_threshold=0.4)
tokens_in_order sorts tokens by frame number rather than as text. add_to_viser takes an
origin because py123d draws a scene relative to its centre, and an overlay that skips it lands
hundreds of metres away.
py123d’s label vocabulary is coarse on purpose, VEHICLE and TWO_WHEELER rather than car, truck
and bus, so a fine grained taxonomy cannot round-trip through it. mixed_8cls loses four of its
eight classes and nuscenes_detection_10cls all ten. Those boxes still draw, as GENERIC_OBJECT,
they just stop being told apart by colour. unmapped_classes(taxonomy) says which classes are
affected.
A note on matplotlib¶
The viz extra needs matplotlib 3.8 or newer. Older versions raise on np.Inf, which NumPy 2.0
removed, inside matplotlib’s own title positioning. If a render fails with that error, the
matplotlib in your environment is too old for its numpy.