@mediapipe/tasks-vision 0.10.8 → 0.10.9-rc.20231209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/vision.d.ts +18 -0
- package/vision_bundle.cjs +1 -1
- package/vision_bundle.cjs.map +1 -1
- package/vision_bundle.mjs +1 -1
- package/vision_bundle.mjs.map +1 -1
- package/wasm/vision_wasm_internal.js +0 -0
- package/wasm/vision_wasm_internal.wasm +0 -0
- package/wasm/vision_wasm_nosimd_internal.js +0 -0
- package/wasm/vision_wasm_nosimd_internal.wasm +0 -0
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ const vision = await FilesetResolver.forVisionTasks(
|
|
|
66
66
|
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm"
|
|
67
67
|
);
|
|
68
68
|
const gestureRecognizer = await GestureRecognizer.createFromModelPath(vision,
|
|
69
|
-
"
|
|
69
|
+
"https://storage.googleapis.com/mediapipe-models/gesture_recognizer/gesture_recognizer/float16/1/gesture_recognizer.task"
|
|
70
70
|
);
|
|
71
71
|
const image = document.getElementById("image") as HTMLImageElement;
|
|
72
72
|
const recognitions = gestureRecognizer.recognize(image);
|
package/package.json
CHANGED
package/vision.d.ts
CHANGED
|
@@ -325,6 +325,23 @@ export declare class DrawingUtils {
|
|
|
325
325
|
* black.
|
|
326
326
|
*/
|
|
327
327
|
drawCategoryMask(mask: MPMask, categoryToColorMap: RGBAColor[], background?: RGBAColor | ImageSource): void;
|
|
328
|
+
/**
|
|
329
|
+
* Blends two images using the provided confidence mask.
|
|
330
|
+
*
|
|
331
|
+
* If you are using an `ImageData` or `HTMLImageElement` as your data source
|
|
332
|
+
* and drawing the result onto a `WebGL2RenderingContext`, this method uploads
|
|
333
|
+
* the image data to the GPU. For still image input that gets re-used every
|
|
334
|
+
* frame, you can reduce the cost of re-uploading these images by passing a
|
|
335
|
+
* `HTMLCanvasElement` instead.
|
|
336
|
+
*
|
|
337
|
+
* @export
|
|
338
|
+
* @param mask A confidence mask that was returned from a segmentation task.
|
|
339
|
+
* @param defaultTexture An image or a four-channel color that will be used
|
|
340
|
+
* when confidence values are low.
|
|
341
|
+
* @param overlayTexture An image or four-channel color that will be used when
|
|
342
|
+
* confidence values are high.
|
|
343
|
+
*/
|
|
344
|
+
drawConfidenceMask(mask: MPMask, defaultTexture: RGBAColor | ImageSource, overlayTexture: RGBAColor | ImageSource): void;
|
|
328
345
|
/**
|
|
329
346
|
* Frees all WebGL resources held by this class.
|
|
330
347
|
* @export
|
|
@@ -1940,6 +1957,7 @@ export declare class MPImage {
|
|
|
1940
1957
|
* `close()` on the `MPMask` instance.
|
|
1941
1958
|
*/
|
|
1942
1959
|
export declare class MPMask {
|
|
1960
|
+
readonly interpolateValues: boolean;
|
|
1943
1961
|
/** Returns the canvas element that the mask is bound to. */
|
|
1944
1962
|
readonly canvas: HTMLCanvasElement | OffscreenCanvas | undefined;
|
|
1945
1963
|
/** Returns the width of the mask. */
|