Class BackgroundSegmentationAssetLoader

Constructors

Methods

Constructors

Methods

  • Load the processor by inserting a <script src> tag pointing at the CDN. Resolves when the script has loaded and BackgroundSegmentationProcessor is available on window.

    This method deduplicates concurrent calls by reusing the same promise and allows retries on failure by clearing the promise. If the processor is already loaded on window, returns immediately. If a load is in progress, subsequent calls wait for the same promise instead of creating duplicate script tags. On failure, the promise is cleared to allow retries.

    Returns Promise<number>

    Load time in milliseconds (0 if already loaded)