supervision-js
    Preparing search index...

    Interface WritableDetectionFrameSource

    Detection source that accepts new frames over time.

    This is the ingestion shape used for streaming inference and long-running media sessions. It remains semantic: render artifacts are prepared later by the renderer.

    interface WritableDetectionFrameSource {
        loadFrames(
            startTime: number,
            endTime: number,
            options?: DetectionFrameLoadOptions,
        ): Promise<readonly DetectionFrame[]>;
        getChangesSince?(
            version: number,
            ranges: readonly DetectionFrameSourceVersionRange[],
        ): DetectionFrameSourceChanges;
        destroy?(): void;
        datasetId: string;
        appendFrames(
            frames: readonly DetectionFrame[],
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        appendLiveFrame?(
            frame: DetectionFrame,
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        finalizeCoverage?(
            endTime: number,
        ): Promise<ColdDetectionFrameStoreWriteSummary | null>;
        replaceFrames(
            frames: readonly DetectionFrame[],
        ): Promise<ColdDetectionFrameStoreWriteSummary>;
        clear(): Promise<void>;
        waitForRange(range: DetectionFrameSourceVersionRange): Promise<void>;
        getAvailableRanges(): readonly DetectionFrameSourceVersionRange[];
        getSummary(): ColdDetectionFrameStoreWriteSummary | null;
        getVersion(range?: DetectionFrameSourceVersionRange): number;
    }

    Hierarchy (View Summary)

    Index
    datasetId: string
    • Load semantic detection frames for the requested media-time range.

      Sources should return detection data, not renderer artifacts. Implementers should prefer sorted frames and avoid mutating returned frames after handing them to the renderer. options is additive context; ignoring it stays correct for any source that does not compose other sources.

      Parameters

      Returns Promise<readonly DetectionFrame[]>

    • Returns void

    • Returns Promise<void>

    • Optional coverage hook. Resolve when the source has enough data to answer loadFrames for the requested range.

      Playback awaits it under an enabled detection playback gate, which a session with appendable detections gets by default; otherwise a caller that wants to wait awaits it itself. A composed source fans it out to the entries it composes.

      Returns Promise<void>

    • Optional monotonically increasing source version. Buffered timelines use this to refresh only when the current range changed. Sources that can revise an existing frame must implement this hook; without it, overlapping frame identities are treated as immutable across rolling window loads.

      Parameters

      Returns number