detection_visualization
orchard.evaluation.detection_visualization
¶
Detection visualization utilities.
Renders bounding-box overlays on sample images from the test set, showing ground-truth boxes (green) and predicted boxes (red/blue) with confidence scores. Follows the same PlotContext / _finalize_figure pattern used by the classification visualization module.
show_detections(model, loader, device, classes, save_path=None, ctx=None, n=None, confidence_threshold=_DEFAULT_CONFIDENCE)
¶
Visualize detection predictions with bounding-box overlays.
Renders a grid of sample images from the test loader with ground-truth boxes (green) and predicted boxes (red) above a configurable confidence threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Module
|
Trained detection model in eval mode. |
required |
loader
|
DataLoader[Any]
|
DataLoader yielding |
required |
device
|
device
|
Target device for inference. |
required |
classes
|
list[str]
|
Human-readable class label names. |
required |
save_path
|
Path | None
|
Output file path. If None, displays interactively. |
None
|
ctx
|
PlotContext | None
|
PlotContext with layout and normalization settings. |
None
|
n
|
int | None
|
Number of samples to display. Defaults to |
None
|
confidence_threshold
|
float
|
Minimum score to display a predicted box. |
_DEFAULT_CONFIDENCE
|