The polygon annotation renderer draws closed paths with at least three
media-pixel points. BasePolygonStyle controls their fill, stroke, and
visibility independently from boxes or masks on the same detection.
session.setPresentation({
renderers: [
annotationRenderers.polygon({
style: new BasePolygonStyle({
fill: { alpha: 0.16 },
stroke: { width: 3 },
}),
}),
],
});
The basketball fixture keeps its source masks beside deterministic, mask-derived polygons. That makes it possible to compare the two layers without recovering geometry from rendered pixels.
See Detections And Rendering for the complete detection geometry contract.
When an editing engine is attached, polygons share detection stacking order with retained boxes and other vector geometry. See the editing contract for ordering and the opt-in topmost picking policy.