Building the input
ImageInput.
Options
Turn the diagnostic image on while you are building the feature: it shows you what the model
actually found, which is much faster than reasoning about mask arrays. Turn it off in
production, since rendering it costs time and memory you do not have on a phone.
What comes back
ASegmentationResult holds the regions found. Each carries its class label, a confidence, and
the mask itself, so you can draw an outline, crop to the object, or count instances.