Referring-expression segmentation with Florence-2: takes an Image and a String phrase naming one object, and emits the referent's contours as [Polygon<Double>], rasterised [Mask], or [Segmentation], resolved by the sink.
Typical backends
Mask out a queried object and overlay it for review.
Cut the referent of a phrase out of an image file.
Caveats
- I/O contractThe model emits polygon contours; the
[Mask] and [Segmentation] arms rasterise each referent's contours into one boolean mask, while the [Polygon<Double>] arm returns every contour separately. The Segmentation arm tags the referent with class id zero and full confidence, since this task has no class space or score.
- AccuracyThe task localises a single described referent per phrase; an expression with no visible match returns an empty list, and an empty phrase likewise yields an empty result rather than an error.
- FallbackAny inference failure for one message is logged and an empty result is returned, so the container stays alive across transient errors.
- CostThis is a sequence-to-sequence vision model with multi-beam decoding, so it is slow for live video; a GPU is strongly preferred and CPU is impractical for streaming.
- State lifetimeThe model and the compute device are captured once at startup; weights download from the Hub on first start and changing the model requires a redeploy.