supervision-js
    Preparing search index...

    Interface EditableAnnotationFrameSession

    interface EditableAnnotationFrameSession {
        add(detection: Detection, index?: number): DetectionFrame;
        destroy(): void;
        getSnapshot(): DetectionFrame;
        remove(id: DetectionId): DetectionFrame;
        replace(frame: DetectionFrame): DetectionFrame;
        subscribe(listener: AnnotationFrameMutationListener): () => void;
        transact(
            mutate: (
                detections: {
                    attributes?: string[];
                    className?: string;
                    confidence?: number;
                    id?: string | number;
                    keypoints?: {
                        edges: [fromIndex: number, toIndex: number][];
                        points: { x: number; y: number }[];
                        visibility?: KeypointVisibility[];
                    };
                    locked?: boolean;
                    mask?: {
                        counts: string;
                        encoding: CompressedRle;
                        height: number;
                        width: number;
                    };
                    metadata?: { [key: string]: unknown };
                    polygon?: { points: { x: number; y: number }[] };
                    polyline?: { points: { x: number; y: number }[] };
                    rect?: { height: number; width: number; x: number; y: number };
                    sourceDetectionIndex?: number;
                    sourceId?: string;
                    zIndex?: number;
                }[],
            ) => void,
            detectionIds?: readonly DetectionId[],
        ): DetectionFrame;
        update(
            id: DetectionId,
            update: Partial<Detection> | ((current: Detection) => Detection),
        ): DetectionFrame;
    }
    Index
    • Returns void

    • Parameters

      • mutate: (
            detections: {
                attributes?: string[];
                className?: string;
                confidence?: number;
                id?: string | number;
                keypoints?: {
                    edges: [fromIndex: number, toIndex: number][];
                    points: { x: number; y: number }[];
                    visibility?: KeypointVisibility[];
                };
                locked?: boolean;
                mask?: {
                    counts: string;
                    encoding: CompressedRle;
                    height: number;
                    width: number;
                };
                metadata?: { [key: string]: unknown };
                polygon?: { points: { x: number; y: number }[] };
                polyline?: { points: { x: number; y: number }[] };
                rect?: { height: number; width: number; x: number; y: number };
                sourceDetectionIndex?: number;
                sourceId?: string;
                zIndex?: number;
            }[],
        ) => void
      • OptionaldetectionIds: readonly DetectionId[]

      Returns DetectionFrame