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

Instance segmentation

An instance-segmentation pipeline returns both a bounding_box and a segmentation on each InferenceResult. See SimplifiedPipeline for the shared setup.

import denkflow

pipeline = denkflow.Pipeline.from_denkflow("path/to/model.denkflow", pat="YOUR-PAT")
simplified = denkflow.SimplifiedPipeline(pipeline)

results = simplified.run("path/to/image.jpg", confidence_threshold=0.5)

for image_result in results:
for r in image_result.results:
if r.bounding_box and r.segmentation:
print(f"{r.bounding_box.class_label.name}: {r.bounding_box.confidence:.2f}")