supervision-js
    Preparing search index...

    Interface Detection

    One semantic detection for a media frame.

    A detection may come directly from a model or from a semantic post-processor such as tracking. It stores identity, class, confidence, geometry, mask, and caller metadata, but 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 {
        id?: string | number;
        trackerId?: number;
        sourceId?: string;
        sourceDetectionIndex?: number;
        className?: string;
        confidence?: number;
        attributes?: readonly string[];
        zIndex?: number;
        locked?: boolean;
        rect?: Rect;
        polygon?: PolygonGeometry;
        polyline?: PolylineGeometry;
        keypoints?: KeypointGeometry;
        mask?: CompressedRleDetectionMask;
        metadata?: Record<string, unknown>;
    }
    Index
    id?: string | number

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

    trackerId?: number

    Optional temporal identity assigned by a tracking post-processor. This is separate from id, which remains the annotation/picking identity. Post-processors may update this derived field in place.

    sourceId?: string

    Optional provenance for detections copied from a composed source.

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

    sourceDetectionIndex?: number

    Optional source-local detection index before composition.

    className?: string

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

    confidence?: number

    Optional confidence score from 0 to 1.

    attributes?: readonly string[]

    Optional host-owned annotation attributes.

    zIndex?: number

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

    locked?: boolean

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

    rect?: Rect

    Optional axis-aligned media-pixel rectangle.

    polygon?: PolygonGeometry

    Optional closed polygon in media-pixel coordinates.

    polyline?: PolylineGeometry

    Optional open path in media-pixel coordinates.

    keypoints?: KeypointGeometry

    Optional keypoints and skeleton edges in media-pixel coordinates.

    Optional binary mask in semantic cold-storage form.

    metadata?: Record<string, unknown>

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