supervision-js
    Preparing search index...

    Interface Detection

    One model output for a media frame.

    A detection stores model data only: identity, class, confidence, geometry, mask, and caller metadata. It intentionally does not carry render styling. Styling is resolved through presentation styles so the same detections can be rendered as boxes, masks, labels, or future layers without mutating the underlying annotation data.

    interface Detection {
        attributes?: readonly string[];
        className?: string;
        confidence?: number;
        id?: string | number;
        keypoints?: KeypointGeometry;
        locked?: boolean;
        mask?: CompressedRleDetectionMask;
        metadata?: Record<string, unknown>;
        polygon?: PolygonGeometry;
        polyline?: PolylineGeometry;
        rect?: Rect;
        sourceDetectionIndex?: number;
        sourceId?: string;
        zIndex?: number;
    }
    Index
    attributes?: readonly string[]

    Optional host-owned annotation attributes.

    className?: string

    Optional semantic class name, such as person, vehicle, or basketball.

    confidence?: number

    Optional confidence score from 0 to 1.

    id?: string | number

    Optional stable identity for picking, interaction, and host app metadata.

    keypoints?: KeypointGeometry

    Optional keypoints and skeleton edges in media-pixel coordinates.

    locked?: boolean

    Optional host editing lock. Renderers may still present locked records.

    Optional binary mask in semantic cold-storage form.

    metadata?: Record<string, unknown>

    Caller-owned metadata. The renderer does not interpret this field.

    polygon?: PolygonGeometry

    Optional closed polygon in media-pixel coordinates.

    polyline?: PolylineGeometry

    Optional open path in media-pixel coordinates.

    rect?: Rect

    Optional axis-aligned media-pixel rectangle.

    sourceDetectionIndex?: number

    Optional source-local detection index before composition.

    sourceId?: string

    Optional provenance for detections copied from a composed source.

    This is renderer-neutral source identity, not product workflow state.

    zIndex?: number

    Optional per-annotation render and pick order. Higher values are on top.