web library

Browser-only support used by MP task runtimes.

Import this library only from code compiled for the web.

Classes

WebTaskAssets
A pinned ECMAScript module and its adjacent MediaPipe Wasm directory.

Functions

callWebMethod<R extends JSAny?>(JSObject receiver, String method, [List<JSAny?> arguments = const <JSAny?>[]]) → R
Calls a JavaScript method with a bounded list of arguments.
importWebTaskModule(Uri moduleUri) → Future<JSObject>
Imports an ECMAScript module without requiring a script tag in index.html.
requireWebObject(JSObject receiver, String property) → JSObject
Gets a required JavaScript object property.
resolveWebBaseOptions(BaseOptions options) → Future<Map<String, Object?>>
Resolves model options and verifies checksum-pinned remote models in Dart.
webBaseOptions(BaseOptions options) → Map<String, Object?>
Maps common model options to the MediaPipe Tasks web API.
webClassificationResult(Map<Object?, Object?> result) → ClassificationResult
Converts a JSON-like MediaPipe web classification result.
webClassifierOptions(ClassifierOptions? options) → Map<String, Object?>
Maps common classifier filtering options to the web API.
webDartify(JSAny? value) → Object?
Converts a JavaScript result containing plain objects and typed arrays.
webEmbedderOptions(EmbedderOptions options) → Map<String, Object?>
Maps common embedder options to the web API.
webEmptyToNull(String? value) → String?
Treats MediaPipe's empty optional strings as absent values.
webImageData(MpImage image) → JSObject
Converts an immutable MpImage into browser ImageData.
webJsify(Object? value) → JSAny?
Converts a Dart JSON-like value to a JavaScript value.
webOptionalInt(Object? value) → int?
Converts a JavaScript number into a Dart integer without trusting its shape.