Visualizing results
Learn how to view original frames, model-ready tensors, and overlay images returned in each inference result.
Estimated read time: 3 minutes
Visualization centers on three attributes: result.image (original frame), result.image_model (model-preprocessed frame), and result.image_overlay (annotated output). This page shows how to preview each field and tune overlay options. Each example includes inline setup so you can copy and run sections independently.
Preview overlays quickly
Display provides a windowed or inline preview, depending on your runtime. It accepts NumPy arrays in BGR order.
Example
from degirum_tools import ModelSpec, Display, remote_assets
model_spec = ModelSpec(
model_name="yolov8n_coco--640x640_quant_hailort_multidevice_1",
zoo_url="degirum/hailo",
inference_host_address="@local",
model_properties={"device_type": ["HAILORT/HAILO8L", "HAILORT/HAILO8"]},
)
model = model_spec.load_model()
result = model(remote_assets.three_persons)
with Display("AI Camera — Overlay preview") as output_display:
output_display.show_image(result.image_overlay)
print("Rendered overlay — close the display window to exit")Example output:
Compare original and overlay frames
Use OpenCV to convert NumPy arrays into PNGs for before/after comparisons or debugging postprocessing.
Example
Example output:
Adjust overlay styling via ModelSpec
You can set overlay properties when you build the ModelSpec. Pass the overlay fields you need alongside the device configuration.
Example
Example output:
Last updated
Was this helpful?

