Import the segmenter model in a more statically-analyzable way

This commit is contained in:
Robin
2025-04-28 15:58:50 +02:00
parent c91cc79162
commit e88e0b1901

View File

@@ -1,5 +1,5 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2024-2025 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
@@ -12,6 +12,8 @@ import {
} from "@livekit/track-processors";
import { ImageSegmenter } from "@mediapipe/tasks-vision";
import modelAssetPath from "../mediapipe/imageSegmenter/selfie_segmenter.tflite?url";
interface WasmFileset {
/** The path to the Wasm loader script. */
wasmLoaderPath: string;
@@ -32,11 +34,6 @@ const wasmFileset: WasmFileset = {
).href,
};
const modelAssetPath = new URL(
"../mediapipe/imageSegmenter/selfie_segmenter.tflite",
import.meta.url,
).href;
export class BlurBackgroundTransformer extends BackgroundTransformer {
public async init({
outputCanvas,