Resolves the files required for the MediaPipe Task APIs.
This class verifies whether SIMD is supported in the current environment and loads the SIMD files only if support is detected. 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.
Returns whether SIMD is supported in the current environment.If your environment requires custom locations for the MediaPipe Wasm files, you can use isSimdSupported() to decide whether to load the SIMD-based assets. Whether SIMD support was detected in the current environment.
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. A WasmFileset that can be used to initialize MediaPipe Audio tasks.
Returns:
Promise<WasmFileset>
FilesetResolver.forGenAiExperimentalTasks()
Creates a fileset for the MediaPipe GenAI Experimental tasks.
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. A WasmFileset that can be used to initialize MediaPipe GenAI tasks.
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. A WasmFileset that can be used to initialize MediaPipe GenAI tasks.
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. A WasmFileset that can be used to initialize MediaPipe Text tasks.
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. A WasmFileset that can be used to initialize MediaPipe Vision tasks.
Returns:
Promise<WasmFileset>
FilesetResolver.isSimdSupported()
Returns whether SIMD is supported in the current environment.
If your environment requires custom locations for the MediaPipe Wasm files, you can use isSimdSupported() to decide whether to load the SIMD-based assets.
Whether SIMD support was detected in the current environment.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-07 UTC."],[],[],null,["# FilesetResolver class\n\n\u003cbr /\u003e\n\nResolves the files required for the MediaPipe Task APIs.\n\nThis class verifies whether SIMD is supported in the current environment and loads the SIMD files only if support is detected. 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`.\n\n**Signature:** \n\n export declare class FilesetResolver \n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|---------------------------------------------------------------------------------------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [forAudioTasks(basePath)](./tasks-audio.filesetresolver#filesetresolverforaudiotasks) | `static` | Creates a fileset for the MediaPipe Audio tasks. |\n| [forGenAiExperimentalTasks(basePath)](./tasks-audio.filesetresolver#filesetresolverforgenaiexperimentaltasks) | `static` | Creates a fileset for the MediaPipe GenAI Experimental tasks. |\n| [forGenAiTasks(basePath)](./tasks-audio.filesetresolver#filesetresolverforgenaitasks) | `static` | Creates a fileset for the MediaPipe GenAI tasks. |\n| [forTextTasks(basePath)](./tasks-audio.filesetresolver#filesetresolverfortexttasks) | `static` | Creates a fileset for the MediaPipe Text tasks. |\n| [forVisionTasks(basePath)](./tasks-audio.filesetresolver#filesetresolverforvisiontasks) | `static` | Creates a fileset for the MediaPipe Vision tasks. |\n| [isSimdSupported()](./tasks-audio.filesetresolver#filesetresolverissimdsupported) | `static` | Returns whether SIMD is supported in the current environment.If your environment requires custom locations for the MediaPipe Wasm files, you can use `isSimdSupported()` to decide whether to load the SIMD-based assets. Whether SIMD support was detected in the current environment. |\n\nFilesetResolver.forAudioTasks()\n-------------------------------\n\nCreates a fileset for the MediaPipe Audio tasks.\n\n**Signature:** \n\n static forAudioTasks(basePath?: string): Promise\u003cWasmFileset\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. A `WasmFileset` that can be used to initialize MediaPipe Audio tasks. |\n\n**Returns:**\n\nPromise\\\u003cWasmFileset\\\u003e\n\nFilesetResolver.forGenAiExperimentalTasks()\n-------------------------------------------\n\nCreates a fileset for the MediaPipe GenAI Experimental tasks.\n\n**Signature:** \n\n static forGenAiExperimentalTasks(basePath?: string): Promise\u003cWasmFileset\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. A `WasmFileset` that can be used to initialize MediaPipe GenAI tasks. |\n\n**Returns:**\n\nPromise\\\u003cWasmFileset\\\u003e\n\nFilesetResolver.forGenAiTasks()\n-------------------------------\n\nCreates a fileset for the MediaPipe GenAI tasks.\n\n**Signature:** \n\n static forGenAiTasks(basePath?: string): Promise\u003cWasmFileset\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. A `WasmFileset` that can be used to initialize MediaPipe GenAI tasks. |\n\n**Returns:**\n\nPromise\\\u003cWasmFileset\\\u003e\n\nFilesetResolver.forTextTasks()\n------------------------------\n\nCreates a fileset for the MediaPipe Text tasks.\n\n**Signature:** \n\n static forTextTasks(basePath?: string): Promise\u003cWasmFileset\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. A `WasmFileset` that can be used to initialize MediaPipe Text tasks. |\n\n**Returns:**\n\nPromise\\\u003cWasmFileset\\\u003e\n\nFilesetResolver.forVisionTasks()\n--------------------------------\n\nCreates a fileset for the MediaPipe Vision tasks.\n\n**Signature:** \n\n static forVisionTasks(basePath?: string): Promise\u003cWasmFileset\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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. A `WasmFileset` that can be used to initialize MediaPipe Vision tasks. |\n\n**Returns:**\n\nPromise\\\u003cWasmFileset\\\u003e\n\nFilesetResolver.isSimdSupported()\n---------------------------------\n\nReturns whether SIMD is supported in the current environment.\n\nIf your environment requires custom locations for the MediaPipe Wasm files, you can use `isSimdSupported()` to decide whether to load the SIMD-based assets.\n\nWhether SIMD support was detected in the current environment.\n\n**Signature:** \n\n static isSimdSupported(): Promise\u003cboolean\u003e;\n\n**Returns:**\n\nPromise\\\u003cboolean\\\u003e"]]