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