FilesetResolver class

Resolves the files required for the MediaPipe Task APIs.

The returned filesets require that the Wasm files are published without renaming. If this is not possible, you can invoke the MediaPipe Tasks APIs using a manually created WasmFileset.

Signature:

export declare class FilesetResolver 

Methods

Method Modifiers Description
forAudioTasks(basePath, useModule) static Creates a fileset for the MediaPipe Audio tasks.
forDecisionTasks(basePath, useModule) static Creates a fileset for the MediaPipe Decision tasks.
forGenAiTasks(basePath, useModule) static Creates a fileset for the MediaPipe GenAI tasks.
forLiteRtLmTextTasks(basePath, useModule) static Creates a fileset for the MediaPipe LiteRT LM Text tasks.
forRetrievalTasks(basePath, useModule) static Creates a fileset for the MediaPipe Retrieval tasks.
forTextTasks(basePath, useModule) static Creates a fileset for the MediaPipe Text tasks.
forVisionTasks(basePath, useModule) static Creates a fileset for the MediaPipe Vision tasks.

FilesetResolver.forAudioTasks()

Creates a fileset for the MediaPipe Audio tasks.

Signature:

static forAudioTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe Audio tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forDecisionTasks()

Creates a fileset for the MediaPipe Decision tasks.

Signature:

static forDecisionTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe Decision tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forGenAiTasks()

Creates a fileset for the MediaPipe GenAI tasks.

Signature:

static forGenAiTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe GenAI tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forLiteRtLmTextTasks()

Creates a fileset for the MediaPipe LiteRT LM Text tasks.

Signature:

static forLiteRtLmTextTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe LiteRT LM Text tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forRetrievalTasks()

Creates a fileset for the MediaPipe Retrieval tasks.

Signature:

static forRetrievalTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe Retrieval tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forTextTasks()

Creates a fileset for the MediaPipe Text tasks.

Signature:

static forTextTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe Text tasks.

Returns:

Promise<WasmFileset>

FilesetResolver.forVisionTasks()

Creates a fileset for the MediaPipe Vision tasks.

Signature:

static forVisionTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;

Parameters

Parameter Type Description
basePath string An optional base path to specify the directory the Wasm files should be loaded from. If not specified, the Wasm files are loaded from the host's root directory.
useModule boolean Whether to use ES6 Modules for the Wasm files. A WasmFileset that can be used to initialize MediaPipe Vision tasks.

Returns:

Promise<WasmFileset>