supervision-js
    Preparing search index...

    Polygons

    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.