
Real-time instance segmentation on an Image with an Ultralytics YOLO weights file. The sink resolves the projection: mask-plus-box pairs, masks, boxes, parallel arrays, a merged Mask, a UInt64 count, or a colourised label Image.
Live segmentation overlay streamed to the browser.
Segment then track instances across frames.
img_size should be close to the checkpoint's training resolution; a very different value silently degrades quality.
object_classes empty keeps every class while a non-empty list restricts detection to those ids, and class_thresholds overrides the confidence for specific classes with the rest falling back to threshold.
iou sets the overlap bound for non-maximum suppression, trading duplicate suppression against merging nearby distinct instances.
Automated release