Skip to main content
Version: 0.10.x [Latest Beta]

Interpreting results

run returns a list of ImageInferenceResult, one per input image. Each holds a flat list of InferenceResult entries under results.

InferenceResult

Each InferenceResult carries the output of one network stage. The populated field depends on network_type:

FieldPopulated for
bounding_boxobject detection, instance segmentation
segmentationsegmentation, instance segmentation
scalarclassification, anomaly detection
textoptical character recognition
barcodebarcode reading
sub_resultsnested results from downstream stages

Additional fields: network_type (the producing stage), index (position within its sibling list), and batch_index (the source image). Coordinates on bounding_box, segmentation and barcoce are absolute pixel values.

Object definition

class InferenceResult:
network_type: str
batch_index: int
index: int
sub_results: list[InferenceResult]
scalar: Scalar | None
bounding_box: BoundingBox | None
segmentation: Segmentation | None
text: str | None
barcode: Barcode | None

Walking the results

for image_result in results:
for r in image_result.results:
if r.bounding_box:
print(r.bounding_box.class_label.name, r.bounding_box.confidence)
if r.text is not None:
print(r.text)
for sub in r.sub_results:
... # nested stage output

Nested pipelines (for example detection followed by per-object classification) expose the downstream output under sub_results.