A read-only instance mask returned as match.mask by a YOLO segmentation model. Coordinates are current-screen pixels, including when inference uses a region. The mask is a snapshot at prototype resolution, not a guarantee that a location is safe to interact with.
Syntax
SegmentationMaskThis class cannot be constructed directly.
Returns
—Example
# Choose an interior point in a segmented region
model = TfliteModel("water")
for hit in model.inference():
if hit.mask is not None:
point = hit.mask.find_point(margin=12)
if point is not None:
print(point)Fields
| Name | Description |
|---|---|
widthInt | Mask grid width in cells. |
heightInt | Mask grid height in cells. |
boundsRegion | Screen-pixel bounds of the visible mask cells, clipped to the inference region. |
areaNumber | Approximate covered area in square screen pixels, at mask-grid resolution. |