@mediapipe/tasks-vision 0.10.3 → 0.10.5
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/package.json +3 -2
- package/vision.d.ts +190 -118
- 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 +2 -2
- package/wasm/vision_wasm_internal.wasm +0 -0
- package/wasm/vision_wasm_nosimd_internal.js +2 -2
- package/wasm/vision_wasm_nosimd_internal.wasm +0 -0
package/vision.d.ts
CHANGED
|
@@ -224,6 +224,7 @@ export declare class DrawingUtils {
|
|
|
224
224
|
/**
|
|
225
225
|
* Restricts a number between two endpoints (order doesn't matter).
|
|
226
226
|
*
|
|
227
|
+
* @export
|
|
227
228
|
* @param x The number to clamp.
|
|
228
229
|
* @param x0 The first boundary.
|
|
229
230
|
* @param x1 The second boundary.
|
|
@@ -234,6 +235,7 @@ export declare class DrawingUtils {
|
|
|
234
235
|
* Linearly interpolates a value between two points, clamping that value to
|
|
235
236
|
* the endpoints.
|
|
236
237
|
*
|
|
238
|
+
* @export
|
|
237
239
|
* @param x The number to interpolate.
|
|
238
240
|
* @param x0 The x coordinate of the start value.
|
|
239
241
|
* @param x1 The x coordinate of the end value.
|
|
@@ -245,6 +247,7 @@ export declare class DrawingUtils {
|
|
|
245
247
|
/**
|
|
246
248
|
* Draws circles onto the provided landmarks.
|
|
247
249
|
*
|
|
250
|
+
* @export
|
|
248
251
|
* @param landmarks The landmarks to draw.
|
|
249
252
|
* @param style The style to visualize the landmarks.
|
|
250
253
|
*/
|
|
@@ -252,6 +255,7 @@ export declare class DrawingUtils {
|
|
|
252
255
|
/**
|
|
253
256
|
* Draws lines between landmarks (given a connection graph).
|
|
254
257
|
*
|
|
258
|
+
* @export
|
|
255
259
|
* @param landmarks The landmarks to draw.
|
|
256
260
|
* @param connections The connections array that contains the start and the
|
|
257
261
|
* end indices for the connections to draw.
|
|
@@ -261,6 +265,7 @@ export declare class DrawingUtils {
|
|
|
261
265
|
/**
|
|
262
266
|
* Draws a bounding box.
|
|
263
267
|
*
|
|
268
|
+
* @export
|
|
264
269
|
* @param boundingBox The bounding box to draw.
|
|
265
270
|
* @param style The style to visualize the boundin box.
|
|
266
271
|
*/
|
|
@@ -432,6 +437,7 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
432
437
|
/**
|
|
433
438
|
* Initializes the Wasm runtime and creates a new `FaceLandmarker` from the
|
|
434
439
|
* provided options.
|
|
440
|
+
* @export
|
|
435
441
|
* @param wasmFileset A configuration object that provides the location of the
|
|
436
442
|
* Wasm binary and its loader.
|
|
437
443
|
* @param faceLandmarkerOptions The options for the FaceLandmarker.
|
|
@@ -442,6 +448,7 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
442
448
|
/**
|
|
443
449
|
* Initializes the Wasm runtime and creates a new `FaceLandmarker` based on
|
|
444
450
|
* the provided model asset buffer.
|
|
451
|
+
* @export
|
|
445
452
|
* @param wasmFileset A configuration object that provides the location of the
|
|
446
453
|
* Wasm binary and its loader.
|
|
447
454
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -450,37 +457,72 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
450
457
|
/**
|
|
451
458
|
* Initializes the Wasm runtime and creates a new `FaceLandmarker` based on
|
|
452
459
|
* the path to the model asset.
|
|
460
|
+
* @export
|
|
453
461
|
* @param wasmFileset A configuration object that provides the location of the
|
|
454
462
|
* Wasm binary and its loader.
|
|
455
463
|
* @param modelAssetPath The path to the model asset.
|
|
456
464
|
*/
|
|
457
465
|
static createFromModelPath(wasmFileset: WasmFileset, modelAssetPath: string): Promise<FaceLandmarker>;
|
|
458
|
-
/**
|
|
466
|
+
/**
|
|
467
|
+
* Landmark connections to draw the connection between a face's lips.
|
|
468
|
+
* @export
|
|
469
|
+
* @nocollapse
|
|
470
|
+
*/
|
|
459
471
|
static FACE_LANDMARKS_LIPS: Connection[];
|
|
460
|
-
/**
|
|
472
|
+
/**
|
|
473
|
+
* Landmark connections to draw the connection between a face's left eye.
|
|
474
|
+
* @export
|
|
475
|
+
* @nocollapse
|
|
476
|
+
*/
|
|
461
477
|
static FACE_LANDMARKS_LEFT_EYE: Connection[];
|
|
462
478
|
/**
|
|
463
479
|
* Landmark connections to draw the connection between a face's left eyebrow.
|
|
480
|
+
* @export
|
|
481
|
+
* @nocollapse
|
|
464
482
|
*/
|
|
465
483
|
static FACE_LANDMARKS_LEFT_EYEBROW: Connection[];
|
|
466
|
-
/**
|
|
484
|
+
/**
|
|
485
|
+
* Landmark connections to draw the connection between a face's left iris.
|
|
486
|
+
* @export
|
|
487
|
+
* @nocollapse
|
|
488
|
+
*/
|
|
467
489
|
static FACE_LANDMARKS_LEFT_IRIS: Connection[];
|
|
468
|
-
/**
|
|
490
|
+
/**
|
|
491
|
+
* Landmark connections to draw the connection between a face's right eye.
|
|
492
|
+
* @export
|
|
493
|
+
* @nocollapse
|
|
494
|
+
*/
|
|
469
495
|
static FACE_LANDMARKS_RIGHT_EYE: Connection[];
|
|
470
496
|
/**
|
|
471
497
|
* Landmark connections to draw the connection between a face's right
|
|
472
498
|
* eyebrow.
|
|
499
|
+
* @export
|
|
500
|
+
* @nocollapse
|
|
473
501
|
*/
|
|
474
502
|
static FACE_LANDMARKS_RIGHT_EYEBROW: Connection[];
|
|
475
503
|
/**
|
|
476
504
|
* Landmark connections to draw the connection between a face's right iris.
|
|
505
|
+
* @export
|
|
506
|
+
* @nocollapse
|
|
477
507
|
*/
|
|
478
508
|
static FACE_LANDMARKS_RIGHT_IRIS: Connection[];
|
|
479
|
-
/**
|
|
509
|
+
/**
|
|
510
|
+
* Landmark connections to draw the face's oval.
|
|
511
|
+
* @export
|
|
512
|
+
* @nocollapse
|
|
513
|
+
*/
|
|
480
514
|
static FACE_LANDMARKS_FACE_OVAL: Connection[];
|
|
481
|
-
/**
|
|
515
|
+
/**
|
|
516
|
+
* Landmark connections to draw the face's contour.
|
|
517
|
+
* @export
|
|
518
|
+
* @nocollapse
|
|
519
|
+
*/
|
|
482
520
|
static FACE_LANDMARKS_CONTOURS: Connection[];
|
|
483
|
-
/**
|
|
521
|
+
/**
|
|
522
|
+
* Landmark connections to draw the face's tesselation.
|
|
523
|
+
* @export
|
|
524
|
+
* @nocollapse
|
|
525
|
+
*/
|
|
484
526
|
static FACE_LANDMARKS_TESSELATION: Connection[];
|
|
485
527
|
private constructor();
|
|
486
528
|
/**
|
|
@@ -490,6 +532,7 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
490
532
|
* You can reset an option back to its default value by explicitly setting it
|
|
491
533
|
* to `undefined`.
|
|
492
534
|
*
|
|
535
|
+
* @export
|
|
493
536
|
* @param options The options for the face landmarker.
|
|
494
537
|
*/
|
|
495
538
|
setOptions(options: FaceLandmarkerOptions): Promise<void>;
|
|
@@ -498,6 +541,7 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
498
541
|
* synchronously for the response. Only use this method when the
|
|
499
542
|
* FaceLandmarker is created with running mode `image`.
|
|
500
543
|
*
|
|
544
|
+
* @export
|
|
501
545
|
* @param image An image to process.
|
|
502
546
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
503
547
|
* to process the input image before running inference.
|
|
@@ -509,6 +553,7 @@ export declare class FaceLandmarker extends VisionTaskRunner {
|
|
|
509
553
|
* synchronously for the response. Only use this method when the
|
|
510
554
|
* FaceLandmarker is created with running mode `video`.
|
|
511
555
|
*
|
|
556
|
+
* @export
|
|
512
557
|
* @param videoFrame A video frame to process.
|
|
513
558
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
514
559
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -571,6 +616,7 @@ export declare class FaceStylizer extends VisionTaskRunner {
|
|
|
571
616
|
/**
|
|
572
617
|
* Initializes the Wasm runtime and creates a new Face Stylizer from the
|
|
573
618
|
* provided options.
|
|
619
|
+
* @export
|
|
574
620
|
* @param wasmFileset A configuration object that provides the location of
|
|
575
621
|
* the Wasm binary and its loader.
|
|
576
622
|
* @param faceStylizerOptions The options for the Face Stylizer. Note
|
|
@@ -581,6 +627,7 @@ export declare class FaceStylizer extends VisionTaskRunner {
|
|
|
581
627
|
/**
|
|
582
628
|
* Initializes the Wasm runtime and creates a new Face Stylizer based on
|
|
583
629
|
* the provided model asset buffer.
|
|
630
|
+
* @export
|
|
584
631
|
* @param wasmFileset A configuration object that provides the location of
|
|
585
632
|
* the Wasm binary and its loader.
|
|
586
633
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -589,6 +636,7 @@ export declare class FaceStylizer extends VisionTaskRunner {
|
|
|
589
636
|
/**
|
|
590
637
|
* Initializes the Wasm runtime and creates a new Face Stylizer based on
|
|
591
638
|
* the path to the model asset.
|
|
639
|
+
* @export
|
|
592
640
|
* @param wasmFileset A configuration object that provides the location of
|
|
593
641
|
* the Wasm binary and its loader.
|
|
594
642
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -602,6 +650,7 @@ export declare class FaceStylizer extends VisionTaskRunner {
|
|
|
602
650
|
* options. You can reset an option back to its default value by
|
|
603
651
|
* explicitly setting it to `undefined`.
|
|
604
652
|
*
|
|
653
|
+
* @export
|
|
605
654
|
* @param options The options for the Face Stylizer.
|
|
606
655
|
*/
|
|
607
656
|
setOptions(options: FaceStylizerOptions): Promise<void>;
|
|
@@ -673,94 +722,6 @@ export declare class FaceStylizer extends VisionTaskRunner {
|
|
|
673
722
|
* copied to avoid lifetime issues.
|
|
674
723
|
*/
|
|
675
724
|
stylize(image: ImageSource, imageProcessingOptions: ImageProcessingOptions): MPImage | null;
|
|
676
|
-
/**
|
|
677
|
-
* Performs face stylization on the provided video frame and invokes the
|
|
678
|
-
* callback with result. The method returns synchronously once the callback
|
|
679
|
-
* returns. Only use this method when the FaceStylizer is created with the
|
|
680
|
-
* video running mode.
|
|
681
|
-
*
|
|
682
|
-
* The input frame can be of any size. It's required to provide the video
|
|
683
|
-
* frame's timestamp (in milliseconds). The input timestamps must be
|
|
684
|
-
* monotonically increasing.
|
|
685
|
-
*
|
|
686
|
-
* @param videoFrame A video frame to process.
|
|
687
|
-
* @param timestamp The timestamp of the current frame, in ms.
|
|
688
|
-
* @param callback The callback that is invoked with the stylized image or
|
|
689
|
-
* `null` if no face was detected. The lifetime of the returned data is only
|
|
690
|
-
* guaranteed for the duration of the callback.
|
|
691
|
-
*/
|
|
692
|
-
stylizeForVideo(videoFrame: ImageSource, timestamp: number, callback: FaceStylizerCallback): void;
|
|
693
|
-
/**
|
|
694
|
-
* Performs face stylization on the provided video frame and invokes the
|
|
695
|
-
* callback with result. The method returns synchronously once the callback
|
|
696
|
-
* returns. Only use this method when the FaceStylizer is created with the
|
|
697
|
-
* video running mode.
|
|
698
|
-
*
|
|
699
|
-
* The 'imageProcessingOptions' parameter can be used to specify one or all
|
|
700
|
-
* of:
|
|
701
|
-
* - the rotation to apply to the image before performing stylization, by
|
|
702
|
-
* setting its 'rotationDegrees' property.
|
|
703
|
-
* - the region-of-interest on which to perform stylization, by setting its
|
|
704
|
-
* 'regionOfInterest' property. If not specified, the full image is used.
|
|
705
|
-
* If both are specified, the crop around the region-of-interest is
|
|
706
|
-
* extracted first, then the specified rotation is applied to the crop.
|
|
707
|
-
*
|
|
708
|
-
* The input frame can be of any size. It's required to provide the video
|
|
709
|
-
* frame's timestamp (in milliseconds). The input timestamps must be
|
|
710
|
-
* monotonically increasing.
|
|
711
|
-
*
|
|
712
|
-
* @param videoFrame A video frame to process.
|
|
713
|
-
* @param timestamp The timestamp of the current frame, in ms.
|
|
714
|
-
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
715
|
-
* to process the input image before running inference.
|
|
716
|
-
* @param callback The callback that is invoked with the stylized image or
|
|
717
|
-
* `null` if no face was detected. The lifetime of the returned data is only
|
|
718
|
-
* guaranteed for the duration of the callback.
|
|
719
|
-
*/
|
|
720
|
-
stylizeForVideo(videoFrame: ImageSource, timestamp: number, imageProcessingOptions: ImageProcessingOptions, callback: FaceStylizerCallback): void;
|
|
721
|
-
/**
|
|
722
|
-
* Performs face stylization on the provided video frame. This method creates
|
|
723
|
-
* a copy of the resulting image and should not be used in high-throughput
|
|
724
|
-
* applications. Only use this method when the FaceStylizer is created with the
|
|
725
|
-
* video running mode.
|
|
726
|
-
*
|
|
727
|
-
* The input frame can be of any size. It's required to provide the video
|
|
728
|
-
* frame's timestamp (in milliseconds). The input timestamps must be
|
|
729
|
-
* monotonically increasing.
|
|
730
|
-
*
|
|
731
|
-
* @param videoFrame A video frame to process.
|
|
732
|
-
* @param timestamp The timestamp of the current frame, in ms.
|
|
733
|
-
* @return A stylized face or `null` if no face was detected. The result is
|
|
734
|
-
* copied to avoid lifetime issues.
|
|
735
|
-
*/
|
|
736
|
-
stylizeForVideo(videoFrame: ImageSource, timestamp: number): MPImage | null;
|
|
737
|
-
/**
|
|
738
|
-
* Performs face stylization on the provided video frame. This method creates
|
|
739
|
-
* a copy of the resulting image and should not be used in high-throughput
|
|
740
|
-
* applictions. Only use this method when the FaceStylizer is created with the
|
|
741
|
-
* video running mode.
|
|
742
|
-
*
|
|
743
|
-
* The 'imageProcessingOptions' parameter can be used to specify one or all
|
|
744
|
-
* of:
|
|
745
|
-
* - the rotation to apply to the image before performing stylization, by
|
|
746
|
-
* setting its 'rotationDegrees' property.
|
|
747
|
-
* - the region-of-interest on which to perform stylization, by setting its
|
|
748
|
-
* 'regionOfInterest' property. If not specified, the full image is used.
|
|
749
|
-
* If both are specified, the crop around the region-of-interest is
|
|
750
|
-
* extracted first, then the specified rotation is applied to the crop.
|
|
751
|
-
*
|
|
752
|
-
* The input frame can be of any size. It's required to provide the video
|
|
753
|
-
* frame's timestamp (in milliseconds). The input timestamps must be
|
|
754
|
-
* monotonically increasing.
|
|
755
|
-
*
|
|
756
|
-
* @param videoFrame A video frame to process.
|
|
757
|
-
* @param timestamp The timestamp of the current frame, in ms.
|
|
758
|
-
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
759
|
-
* to process the input image before running inference.
|
|
760
|
-
* @return A stylized face or `null` if no face was detected. The result is
|
|
761
|
-
* copied to avoid lifetime issues.
|
|
762
|
-
*/
|
|
763
|
-
stylizeForVideo(videoFrame: ImageSource, timestamp: number, imageProcessingOptions: ImageProcessingOptions): MPImage | null;
|
|
764
725
|
}
|
|
765
726
|
|
|
766
727
|
/**
|
|
@@ -793,12 +754,14 @@ export declare class FilesetResolver {
|
|
|
793
754
|
* you can use `isSimdSupported()` to decide whether to load the SIMD-based
|
|
794
755
|
* assets.
|
|
795
756
|
*
|
|
757
|
+
* @export
|
|
796
758
|
* @return Whether SIMD support was detected in the current environment.
|
|
797
759
|
*/
|
|
798
760
|
static isSimdSupported(): Promise<boolean>;
|
|
799
761
|
/**
|
|
800
762
|
* Creates a fileset for the MediaPipe Audio tasks.
|
|
801
763
|
*
|
|
764
|
+
* @export
|
|
802
765
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
803
766
|
* files should be loaded from. If not specified, the Wasm files are
|
|
804
767
|
* loaded from the host's root directory.
|
|
@@ -809,6 +772,7 @@ export declare class FilesetResolver {
|
|
|
809
772
|
/**
|
|
810
773
|
* Creates a fileset for the MediaPipe Text tasks.
|
|
811
774
|
*
|
|
775
|
+
* @export
|
|
812
776
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
813
777
|
* files should be loaded from. If not specified, the Wasm files are
|
|
814
778
|
* loaded from the host's root directory.
|
|
@@ -819,6 +783,7 @@ export declare class FilesetResolver {
|
|
|
819
783
|
/**
|
|
820
784
|
* Creates a fileset for the MediaPipe Vision tasks.
|
|
821
785
|
*
|
|
786
|
+
* @export
|
|
822
787
|
* @param basePath An optional base path to specify the directory the Wasm
|
|
823
788
|
* files should be loaded from. If not specified, the Wasm files are
|
|
824
789
|
* loaded from the host's root directory.
|
|
@@ -833,11 +798,14 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
833
798
|
/**
|
|
834
799
|
* An array containing the pairs of hand landmark indices to be rendered with
|
|
835
800
|
* connections.
|
|
801
|
+
* @export
|
|
802
|
+
* @nocollapse
|
|
836
803
|
*/
|
|
837
804
|
static HAND_CONNECTIONS: Connection[];
|
|
838
805
|
/**
|
|
839
806
|
* Initializes the Wasm runtime and creates a new gesture recognizer from the
|
|
840
807
|
* provided options.
|
|
808
|
+
* @export
|
|
841
809
|
* @param wasmFileset A configuration object that provides the location of the
|
|
842
810
|
* Wasm binary and its loader.
|
|
843
811
|
* @param gestureRecognizerOptions The options for the gesture recognizer.
|
|
@@ -848,6 +816,7 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
848
816
|
/**
|
|
849
817
|
* Initializes the Wasm runtime and creates a new gesture recognizer based on
|
|
850
818
|
* the provided model asset buffer.
|
|
819
|
+
* @export
|
|
851
820
|
* @param wasmFileset A configuration object that provides the location of the
|
|
852
821
|
* Wasm binary and its loader.
|
|
853
822
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -856,6 +825,7 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
856
825
|
/**
|
|
857
826
|
* Initializes the Wasm runtime and creates a new gesture recognizer based on
|
|
858
827
|
* the path to the model asset.
|
|
828
|
+
* @export
|
|
859
829
|
* @param wasmFileset A configuration object that provides the location of the
|
|
860
830
|
* Wasm binary and its loader.
|
|
861
831
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -869,6 +839,7 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
869
839
|
* You can reset an option back to its default value by explicitly setting it
|
|
870
840
|
* to `undefined`.
|
|
871
841
|
*
|
|
842
|
+
* @export
|
|
872
843
|
* @param options The options for the gesture recognizer.
|
|
873
844
|
*/
|
|
874
845
|
setOptions(options: GestureRecognizerOptions): Promise<void>;
|
|
@@ -877,6 +848,7 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
877
848
|
* synchronously for the response. Only use this method when the
|
|
878
849
|
* GestureRecognizer is created with running mode `image`.
|
|
879
850
|
*
|
|
851
|
+
* @export
|
|
880
852
|
* @param image A single image to process.
|
|
881
853
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
882
854
|
* to process the input image before running inference.
|
|
@@ -888,6 +860,7 @@ export declare class GestureRecognizer extends VisionTaskRunner {
|
|
|
888
860
|
* synchronously for the response. Only use this method when the
|
|
889
861
|
* GestureRecognizer is created with running mode `video`.
|
|
890
862
|
*
|
|
863
|
+
* @export
|
|
891
864
|
* @param videoFrame A video frame to process.
|
|
892
865
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
893
866
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -943,6 +916,11 @@ export declare interface GestureRecognizerResult {
|
|
|
943
916
|
/** Hand landmarks in world coordniates of detected hands. */
|
|
944
917
|
worldLandmarks: Landmark[][];
|
|
945
918
|
/** Handedness of detected hands. */
|
|
919
|
+
handedness: Category[][];
|
|
920
|
+
/**
|
|
921
|
+
* Handedness of detected hands.
|
|
922
|
+
* @deprecated Use `.handedness` instead.
|
|
923
|
+
*/
|
|
946
924
|
handednesses: Category[][];
|
|
947
925
|
/**
|
|
948
926
|
* Recognized hand gestures of detected hands. Note that the index of the
|
|
@@ -957,11 +935,14 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
957
935
|
/**
|
|
958
936
|
* An array containing the pairs of hand landmark indices to be rendered with
|
|
959
937
|
* connections.
|
|
938
|
+
* @export
|
|
939
|
+
* @nocollapse
|
|
960
940
|
*/
|
|
961
941
|
static HAND_CONNECTIONS: Connection[];
|
|
962
942
|
/**
|
|
963
943
|
* Initializes the Wasm runtime and creates a new `HandLandmarker` from the
|
|
964
944
|
* provided options.
|
|
945
|
+
* @export
|
|
965
946
|
* @param wasmFileset A configuration object that provides the location of the
|
|
966
947
|
* Wasm binary and its loader.
|
|
967
948
|
* @param handLandmarkerOptions The options for the HandLandmarker.
|
|
@@ -972,6 +953,7 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
972
953
|
/**
|
|
973
954
|
* Initializes the Wasm runtime and creates a new `HandLandmarker` based on
|
|
974
955
|
* the provided model asset buffer.
|
|
956
|
+
* @export
|
|
975
957
|
* @param wasmFileset A configuration object that provides the location of the
|
|
976
958
|
* Wasm binary and its loader.
|
|
977
959
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -980,6 +962,7 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
980
962
|
/**
|
|
981
963
|
* Initializes the Wasm runtime and creates a new `HandLandmarker` based on
|
|
982
964
|
* the path to the model asset.
|
|
965
|
+
* @export
|
|
983
966
|
* @param wasmFileset A configuration object that provides the location of the
|
|
984
967
|
* Wasm binary and its loader.
|
|
985
968
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -993,6 +976,7 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
993
976
|
* You can reset an option back to its default value by explicitly setting it
|
|
994
977
|
* to `undefined`.
|
|
995
978
|
*
|
|
979
|
+
* @export
|
|
996
980
|
* @param options The options for the hand landmarker.
|
|
997
981
|
*/
|
|
998
982
|
setOptions(options: HandLandmarkerOptions): Promise<void>;
|
|
@@ -1001,6 +985,7 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
1001
985
|
* synchronously for the response. Only use this method when the
|
|
1002
986
|
* HandLandmarker is created with running mode `image`.
|
|
1003
987
|
*
|
|
988
|
+
* @export
|
|
1004
989
|
* @param image An image to process.
|
|
1005
990
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
1006
991
|
* to process the input image before running inference.
|
|
@@ -1012,6 +997,7 @@ export declare class HandLandmarker extends VisionTaskRunner {
|
|
|
1012
997
|
* synchronously for the response. Only use this method when the
|
|
1013
998
|
* HandLandmarker is created with running mode `video`.
|
|
1014
999
|
*
|
|
1000
|
+
* @export
|
|
1015
1001
|
* @param videoFrame A video frame to process.
|
|
1016
1002
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
1017
1003
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -1053,8 +1039,13 @@ export declare interface HandLandmarkerResult {
|
|
|
1053
1039
|
landmarks: NormalizedLandmark[][];
|
|
1054
1040
|
/** Hand landmarks in world coordinates of detected hands. */
|
|
1055
1041
|
worldLandmarks: Landmark[][];
|
|
1056
|
-
/**
|
|
1042
|
+
/**
|
|
1043
|
+
* Handedness of detected hands.
|
|
1044
|
+
* @deprecated Use `.handedness` instead.
|
|
1045
|
+
*/
|
|
1057
1046
|
handednesses: Category[][];
|
|
1047
|
+
/** Handedness of detected hands. */
|
|
1048
|
+
handedness: Category[][];
|
|
1058
1049
|
}
|
|
1059
1050
|
|
|
1060
1051
|
/** Performs classification on images. */
|
|
@@ -1062,6 +1053,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1062
1053
|
/**
|
|
1063
1054
|
* Initializes the Wasm runtime and creates a new image classifier from the
|
|
1064
1055
|
* provided options.
|
|
1056
|
+
* @export
|
|
1065
1057
|
* @param wasmFileset A configuration object that provides the location
|
|
1066
1058
|
* Wasm binary and its loader.
|
|
1067
1059
|
* @param imageClassifierOptions The options for the image classifier. Note
|
|
@@ -1072,6 +1064,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1072
1064
|
/**
|
|
1073
1065
|
* Initializes the Wasm runtime and creates a new image classifier based on
|
|
1074
1066
|
* the provided model asset buffer.
|
|
1067
|
+
* @export
|
|
1075
1068
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1076
1069
|
* Wasm binary and its loader.
|
|
1077
1070
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -1080,6 +1073,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1080
1073
|
/**
|
|
1081
1074
|
* Initializes the Wasm runtime and creates a new image classifier based on
|
|
1082
1075
|
* the path to the model asset.
|
|
1076
|
+
* @export
|
|
1083
1077
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1084
1078
|
* Wasm binary and its loader.
|
|
1085
1079
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -1093,6 +1087,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1093
1087
|
* You can reset an option back to its default value by explicitly setting it
|
|
1094
1088
|
* to `undefined`.
|
|
1095
1089
|
*
|
|
1090
|
+
* @export
|
|
1096
1091
|
* @param options The options for the image classifier.
|
|
1097
1092
|
*/
|
|
1098
1093
|
setOptions(options: ImageClassifierOptions): Promise<void>;
|
|
@@ -1101,6 +1096,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1101
1096
|
* synchronously for the response. Only use this method when the
|
|
1102
1097
|
* ImageClassifier is created with running mode `image`.
|
|
1103
1098
|
*
|
|
1099
|
+
* @export
|
|
1104
1100
|
* @param image An image to process.
|
|
1105
1101
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
1106
1102
|
* to process the input image before running inference.
|
|
@@ -1112,6 +1108,7 @@ export declare class ImageClassifier extends VisionTaskRunner {
|
|
|
1112
1108
|
* synchronously for the response. Only use this method when the
|
|
1113
1109
|
* ImageClassifier is created with running mode `video`.
|
|
1114
1110
|
*
|
|
1111
|
+
* @export
|
|
1115
1112
|
* @param videoFrame A video frame to process.
|
|
1116
1113
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
1117
1114
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -1146,6 +1143,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1146
1143
|
/**
|
|
1147
1144
|
* Initializes the Wasm runtime and creates a new image embedder from the
|
|
1148
1145
|
* provided options.
|
|
1146
|
+
* @export
|
|
1149
1147
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1150
1148
|
* Wasm binary and its loader.
|
|
1151
1149
|
* @param imageEmbedderOptions The options for the image embedder. Note that
|
|
@@ -1156,6 +1154,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1156
1154
|
/**
|
|
1157
1155
|
* Initializes the Wasm runtime and creates a new image embedder based on the
|
|
1158
1156
|
* provided model asset buffer.
|
|
1157
|
+
* @export
|
|
1159
1158
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1160
1159
|
* Wasm binary and its loader.
|
|
1161
1160
|
* @param modelAssetBuffer A binary representation of the TFLite model.
|
|
@@ -1164,6 +1163,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1164
1163
|
/**
|
|
1165
1164
|
* Initializes the Wasm runtime and creates a new image embedder based on the
|
|
1166
1165
|
* path to the model asset.
|
|
1166
|
+
* @export
|
|
1167
1167
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1168
1168
|
* Wasm binary and its loader.
|
|
1169
1169
|
* @param modelAssetPath The path to the TFLite model.
|
|
@@ -1177,6 +1177,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1177
1177
|
* You can reset an option back to its default value by explicitly setting it
|
|
1178
1178
|
* to `undefined`.
|
|
1179
1179
|
*
|
|
1180
|
+
* @export
|
|
1180
1181
|
* @param options The options for the image embedder.
|
|
1181
1182
|
*/
|
|
1182
1183
|
setOptions(options: ImageEmbedderOptions): Promise<void>;
|
|
@@ -1185,6 +1186,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1185
1186
|
* synchronously for the response. Only use this method when the
|
|
1186
1187
|
* ImageEmbedder is created with running mode `image`.
|
|
1187
1188
|
*
|
|
1189
|
+
* @export
|
|
1188
1190
|
* @param image The image to process.
|
|
1189
1191
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
1190
1192
|
* to process the input image before running inference.
|
|
@@ -1196,6 +1198,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1196
1198
|
* synchronously for the response. Only use this method when the
|
|
1197
1199
|
* ImageEmbedder is created with running mode `video`.
|
|
1198
1200
|
*
|
|
1201
|
+
* @export
|
|
1199
1202
|
* @param imageFrame The image frame to process.
|
|
1200
1203
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
1201
1204
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -1209,6 +1212,7 @@ export declare class ImageEmbedder extends VisionTaskRunner {
|
|
|
1209
1212
|
*
|
|
1210
1213
|
* [1]: https://en.wikipedia.org/wiki/Cosine_similarity
|
|
1211
1214
|
*
|
|
1215
|
+
* @export
|
|
1212
1216
|
* @throws if the embeddings are of different types(float vs. quantized), have
|
|
1213
1217
|
* different sizes, or have an L2-norm of 0.
|
|
1214
1218
|
*/
|
|
@@ -1266,6 +1270,7 @@ export declare class ImageSegmenter extends VisionTaskRunner {
|
|
|
1266
1270
|
/**
|
|
1267
1271
|
* Initializes the Wasm runtime and creates a new image segmenter from the
|
|
1268
1272
|
* provided options.
|
|
1273
|
+
* @export
|
|
1269
1274
|
* @param wasmFileset A configuration object that provides the location of
|
|
1270
1275
|
* the Wasm binary and its loader.
|
|
1271
1276
|
* @param imageSegmenterOptions The options for the Image Segmenter. Note
|
|
@@ -1276,6 +1281,7 @@ export declare class ImageSegmenter extends VisionTaskRunner {
|
|
|
1276
1281
|
/**
|
|
1277
1282
|
* Initializes the Wasm runtime and creates a new image segmenter based on
|
|
1278
1283
|
* the provided model asset buffer.
|
|
1284
|
+
* @export
|
|
1279
1285
|
* @param wasmFileset A configuration object that provides the location of
|
|
1280
1286
|
* the Wasm binary and its loader.
|
|
1281
1287
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -1284,6 +1290,7 @@ export declare class ImageSegmenter extends VisionTaskRunner {
|
|
|
1284
1290
|
/**
|
|
1285
1291
|
* Initializes the Wasm runtime and creates a new image segmenter based on
|
|
1286
1292
|
* the path to the model asset.
|
|
1293
|
+
* @export
|
|
1287
1294
|
* @param wasmFileset A configuration object that provides the location of
|
|
1288
1295
|
* the Wasm binary and its loader.
|
|
1289
1296
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -1297,6 +1304,7 @@ export declare class ImageSegmenter extends VisionTaskRunner {
|
|
|
1297
1304
|
* options. You can reset an option back to its default value by
|
|
1298
1305
|
* explicitly setting it to `undefined`.
|
|
1299
1306
|
*
|
|
1307
|
+
* @export
|
|
1300
1308
|
* @param options The options for the image segmenter.
|
|
1301
1309
|
*/
|
|
1302
1310
|
setOptions(options: ImageSegmenterOptions): Promise<void>;
|
|
@@ -1412,6 +1420,7 @@ export declare class ImageSegmenter extends VisionTaskRunner {
|
|
|
1412
1420
|
* If there is no labelmap provided in the model file, empty label array is
|
|
1413
1421
|
* returned.
|
|
1414
1422
|
*
|
|
1423
|
+
* @export
|
|
1415
1424
|
* @return The labels used by the current model.
|
|
1416
1425
|
*/
|
|
1417
1426
|
getLabels(): string[];
|
|
@@ -1444,18 +1453,21 @@ export declare class ImageSegmenterResult {
|
|
|
1444
1453
|
* Multiple masks represented as `Float32Array` or `WebGLTexture`-backed
|
|
1445
1454
|
* `MPImage`s where, for each mask, each pixel represents the prediction
|
|
1446
1455
|
* confidence, usually in the [0, 1] range.
|
|
1456
|
+
* @export
|
|
1447
1457
|
*/
|
|
1448
1458
|
readonly confidenceMasks?: MPMask[] | undefined;
|
|
1449
1459
|
/**
|
|
1450
1460
|
* A category mask represented as a `Uint8ClampedArray` or
|
|
1451
1461
|
* `WebGLTexture`-backed `MPImage` where each pixel represents the class
|
|
1452
1462
|
* which the pixel in the original image was predicted to belong to.
|
|
1463
|
+
* @export
|
|
1453
1464
|
*/
|
|
1454
1465
|
readonly categoryMask?: MPMask | undefined;
|
|
1455
1466
|
/**
|
|
1456
1467
|
* The quality scores of the result masks, in the range of [0, 1].
|
|
1457
1468
|
* Defaults to `1` if the model doesn't output quality scores. Each
|
|
1458
1469
|
* element corresponds to the score of the category in the model outputs.
|
|
1470
|
+
* @export
|
|
1459
1471
|
*/
|
|
1460
1472
|
readonly qualityScores?: number[] | undefined;
|
|
1461
1473
|
constructor(
|
|
@@ -1463,21 +1475,27 @@ export declare class ImageSegmenterResult {
|
|
|
1463
1475
|
* Multiple masks represented as `Float32Array` or `WebGLTexture`-backed
|
|
1464
1476
|
* `MPImage`s where, for each mask, each pixel represents the prediction
|
|
1465
1477
|
* confidence, usually in the [0, 1] range.
|
|
1478
|
+
* @export
|
|
1466
1479
|
*/
|
|
1467
1480
|
confidenceMasks?: MPMask[] | undefined,
|
|
1468
1481
|
/**
|
|
1469
1482
|
* A category mask represented as a `Uint8ClampedArray` or
|
|
1470
1483
|
* `WebGLTexture`-backed `MPImage` where each pixel represents the class
|
|
1471
1484
|
* which the pixel in the original image was predicted to belong to.
|
|
1485
|
+
* @export
|
|
1472
1486
|
*/
|
|
1473
1487
|
categoryMask?: MPMask | undefined,
|
|
1474
1488
|
/**
|
|
1475
1489
|
* The quality scores of the result masks, in the range of [0, 1].
|
|
1476
1490
|
* Defaults to `1` if the model doesn't output quality scores. Each
|
|
1477
1491
|
* element corresponds to the score of the category in the model outputs.
|
|
1492
|
+
* @export
|
|
1478
1493
|
*/
|
|
1479
1494
|
qualityScores?: number[] | undefined);
|
|
1480
|
-
/**
|
|
1495
|
+
/**
|
|
1496
|
+
* Frees the resources held by the category and confidence masks.
|
|
1497
|
+
* @export
|
|
1498
|
+
*/
|
|
1481
1499
|
close(): void;
|
|
1482
1500
|
}
|
|
1483
1501
|
|
|
@@ -1514,6 +1532,7 @@ export declare class InteractiveSegmenter extends VisionTaskRunner {
|
|
|
1514
1532
|
/**
|
|
1515
1533
|
* Initializes the Wasm runtime and creates a new interactive segmenter from
|
|
1516
1534
|
* the provided options.
|
|
1535
|
+
* @export
|
|
1517
1536
|
* @param wasmFileset A configuration object that provides the location of
|
|
1518
1537
|
* the Wasm binary and its loader.
|
|
1519
1538
|
* @param interactiveSegmenterOptions The options for the Interactive
|
|
@@ -1525,6 +1544,7 @@ export declare class InteractiveSegmenter extends VisionTaskRunner {
|
|
|
1525
1544
|
/**
|
|
1526
1545
|
* Initializes the Wasm runtime and creates a new interactive segmenter based
|
|
1527
1546
|
* on the provided model asset buffer.
|
|
1547
|
+
* @export
|
|
1528
1548
|
* @param wasmFileset A configuration object that provides the location of
|
|
1529
1549
|
* the Wasm binary and its loader.
|
|
1530
1550
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -1534,6 +1554,7 @@ export declare class InteractiveSegmenter extends VisionTaskRunner {
|
|
|
1534
1554
|
/**
|
|
1535
1555
|
* Initializes the Wasm runtime and creates a new interactive segmenter based
|
|
1536
1556
|
* on the path to the model asset.
|
|
1557
|
+
* @export
|
|
1537
1558
|
* @param wasmFileset A configuration object that provides the location of
|
|
1538
1559
|
* the Wasm binary and its loader.
|
|
1539
1560
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -1548,6 +1569,7 @@ export declare class InteractiveSegmenter extends VisionTaskRunner {
|
|
|
1548
1569
|
* options. You can reset an option back to its default value by
|
|
1549
1570
|
* explicitly setting it to `undefined`.
|
|
1550
1571
|
*
|
|
1572
|
+
* @export
|
|
1551
1573
|
* @param options The options for the interactive segmenter.
|
|
1552
1574
|
* @return A Promise that resolves when the settings have been applied.
|
|
1553
1575
|
*/
|
|
@@ -1642,18 +1664,21 @@ export declare class InteractiveSegmenterResult {
|
|
|
1642
1664
|
* Multiple masks represented as `Float32Array` or `WebGLTexture`-backed
|
|
1643
1665
|
* `MPImage`s where, for each mask, each pixel represents the prediction
|
|
1644
1666
|
* confidence, usually in the [0, 1] range.
|
|
1667
|
+
* @export
|
|
1645
1668
|
*/
|
|
1646
1669
|
readonly confidenceMasks?: MPMask[] | undefined;
|
|
1647
1670
|
/**
|
|
1648
1671
|
* A category mask represented as a `Uint8ClampedArray` or
|
|
1649
1672
|
* `WebGLTexture`-backed `MPImage` where each pixel represents the class
|
|
1650
1673
|
* which the pixel in the original image was predicted to belong to.
|
|
1674
|
+
* @export
|
|
1651
1675
|
*/
|
|
1652
1676
|
readonly categoryMask?: MPMask | undefined;
|
|
1653
1677
|
/**
|
|
1654
1678
|
* The quality scores of the result masks, in the range of [0, 1].
|
|
1655
1679
|
* Defaults to `1` if the model doesn't output quality scores. Each
|
|
1656
1680
|
* element corresponds to the score of the category in the model outputs.
|
|
1681
|
+
* @export
|
|
1657
1682
|
*/
|
|
1658
1683
|
readonly qualityScores?: number[] | undefined;
|
|
1659
1684
|
constructor(
|
|
@@ -1661,21 +1686,27 @@ export declare class InteractiveSegmenterResult {
|
|
|
1661
1686
|
* Multiple masks represented as `Float32Array` or `WebGLTexture`-backed
|
|
1662
1687
|
* `MPImage`s where, for each mask, each pixel represents the prediction
|
|
1663
1688
|
* confidence, usually in the [0, 1] range.
|
|
1689
|
+
* @export
|
|
1664
1690
|
*/
|
|
1665
1691
|
confidenceMasks?: MPMask[] | undefined,
|
|
1666
1692
|
/**
|
|
1667
1693
|
* A category mask represented as a `Uint8ClampedArray` or
|
|
1668
1694
|
* `WebGLTexture`-backed `MPImage` where each pixel represents the class
|
|
1669
1695
|
* which the pixel in the original image was predicted to belong to.
|
|
1696
|
+
* @export
|
|
1670
1697
|
*/
|
|
1671
1698
|
categoryMask?: MPMask | undefined,
|
|
1672
1699
|
/**
|
|
1673
1700
|
* The quality scores of the result masks, in the range of [0, 1].
|
|
1674
1701
|
* Defaults to `1` if the model doesn't output quality scores. Each
|
|
1675
1702
|
* element corresponds to the score of the category in the model outputs.
|
|
1703
|
+
* @export
|
|
1676
1704
|
*/
|
|
1677
1705
|
qualityScores?: number[] | undefined);
|
|
1678
|
-
/**
|
|
1706
|
+
/**
|
|
1707
|
+
* Frees the resources held by the category and confidence masks.
|
|
1708
|
+
* @export
|
|
1709
|
+
*/
|
|
1679
1710
|
close(): void;
|
|
1680
1711
|
}
|
|
1681
1712
|
|
|
@@ -1753,17 +1784,27 @@ export declare class MPImage {
|
|
|
1753
1784
|
/** Returns the height of the image. */
|
|
1754
1785
|
readonly height: number;
|
|
1755
1786
|
private constructor();
|
|
1756
|
-
/**
|
|
1787
|
+
/**
|
|
1788
|
+
* Returns whether this `MPImage` contains a mask of type `ImageData`.
|
|
1789
|
+
* @export
|
|
1790
|
+
*/
|
|
1757
1791
|
hasImageData(): boolean;
|
|
1758
|
-
/**
|
|
1792
|
+
/**
|
|
1793
|
+
* Returns whether this `MPImage` contains a mask of type `ImageBitmap`.
|
|
1794
|
+
* @export
|
|
1795
|
+
*/
|
|
1759
1796
|
hasImageBitmap(): boolean;
|
|
1760
|
-
/**
|
|
1797
|
+
/**
|
|
1798
|
+
* Returns whether this `MPImage` contains a mask of type `WebGLTexture`.
|
|
1799
|
+
* @export
|
|
1800
|
+
*/
|
|
1761
1801
|
hasWebGLTexture(): boolean;
|
|
1762
1802
|
/**
|
|
1763
1803
|
* Returns the underlying image as an `ImageData` object. Note that this
|
|
1764
1804
|
* involves an expensive GPU to CPU transfer if the current image is only
|
|
1765
1805
|
* available as an `ImageBitmap` or `WebGLTexture`.
|
|
1766
1806
|
*
|
|
1807
|
+
* @export
|
|
1767
1808
|
* @return The current image as an ImageData object.
|
|
1768
1809
|
*/
|
|
1769
1810
|
getAsImageData(): ImageData;
|
|
@@ -1777,6 +1818,7 @@ export declare class MPImage {
|
|
|
1777
1818
|
* https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/getContext
|
|
1778
1819
|
* for a list of supported platforms.
|
|
1779
1820
|
*
|
|
1821
|
+
* @export
|
|
1780
1822
|
* @return The current image as an ImageBitmap object.
|
|
1781
1823
|
*/
|
|
1782
1824
|
getAsImageBitmap(): ImageBitmap;
|
|
@@ -1786,6 +1828,7 @@ export declare class MPImage {
|
|
|
1786
1828
|
* an `ImageData` object. The returned texture is bound to the current
|
|
1787
1829
|
* canvas (see `.canvas`).
|
|
1788
1830
|
*
|
|
1831
|
+
* @export
|
|
1789
1832
|
* @return The current image as a WebGLTexture.
|
|
1790
1833
|
*/
|
|
1791
1834
|
getAsWebGLTexture(): WebGLTexture;
|
|
@@ -1795,6 +1838,8 @@ export declare class MPImage {
|
|
|
1795
1838
|
* Task. Note that performance critical applications should aim to only use
|
|
1796
1839
|
* the `MPImage` within the MediaPipe Task callback so that copies can be
|
|
1797
1840
|
* avoided.
|
|
1841
|
+
*
|
|
1842
|
+
* @export
|
|
1798
1843
|
*/
|
|
1799
1844
|
clone(): MPImage;
|
|
1800
1845
|
/**
|
|
@@ -1804,6 +1849,8 @@ export declare class MPImage {
|
|
|
1804
1849
|
* Task, as these are freed automatically once you leave the MediaPipe
|
|
1805
1850
|
* callback. Additionally, some shared state is freed only once you invoke the
|
|
1806
1851
|
* Task's `close()` method.
|
|
1852
|
+
*
|
|
1853
|
+
* @export
|
|
1807
1854
|
*/
|
|
1808
1855
|
close(): void;
|
|
1809
1856
|
}
|
|
@@ -1831,17 +1878,27 @@ export declare class MPMask {
|
|
|
1831
1878
|
/** Returns the height of the mask. */
|
|
1832
1879
|
readonly height: number;
|
|
1833
1880
|
private constructor();
|
|
1834
|
-
/**
|
|
1881
|
+
/**
|
|
1882
|
+
* Returns whether this `MPMask` contains a mask of type `Uint8Array`.
|
|
1883
|
+
* @export
|
|
1884
|
+
*/
|
|
1835
1885
|
hasUint8Array(): boolean;
|
|
1836
|
-
/**
|
|
1886
|
+
/**
|
|
1887
|
+
* Returns whether this `MPMask` contains a mask of type `Float32Array`.
|
|
1888
|
+
* @export
|
|
1889
|
+
*/
|
|
1837
1890
|
hasFloat32Array(): boolean;
|
|
1838
|
-
/**
|
|
1891
|
+
/**
|
|
1892
|
+
* Returns whether this `MPMask` contains a mask of type `WebGLTexture`.
|
|
1893
|
+
* @export
|
|
1894
|
+
*/
|
|
1839
1895
|
hasWebGLTexture(): boolean;
|
|
1840
1896
|
/**
|
|
1841
1897
|
* Returns the underlying mask as a Uint8Array`. Note that this involves an
|
|
1842
1898
|
* expensive GPU to CPU transfer if the current mask is only available as a
|
|
1843
1899
|
* `WebGLTexture`.
|
|
1844
1900
|
*
|
|
1901
|
+
* @export
|
|
1845
1902
|
* @return The current data as a Uint8Array.
|
|
1846
1903
|
*/
|
|
1847
1904
|
getAsUint8Array(): Uint8Array;
|
|
@@ -1850,6 +1907,7 @@ export declare class MPMask {
|
|
|
1850
1907
|
* this involves an expensive GPU to CPU transfer if the current mask is
|
|
1851
1908
|
* only available as a `WebGLTexture`.
|
|
1852
1909
|
*
|
|
1910
|
+
* @export
|
|
1853
1911
|
* @return The current mask as a Float32Array.
|
|
1854
1912
|
*/
|
|
1855
1913
|
getAsFloat32Array(): Float32Array;
|
|
@@ -1859,20 +1917,18 @@ export declare class MPMask {
|
|
|
1859
1917
|
* a CPU array. The returned texture is bound to the current canvas (see
|
|
1860
1918
|
* `.canvas`).
|
|
1861
1919
|
*
|
|
1920
|
+
* @export
|
|
1862
1921
|
* @return The current mask as a WebGLTexture.
|
|
1863
1922
|
*/
|
|
1864
1923
|
getAsWebGLTexture(): WebGLTexture;
|
|
1865
|
-
/**
|
|
1866
|
-
* Returns the texture format used for writing float textures on this
|
|
1867
|
-
* platform.
|
|
1868
|
-
*/
|
|
1869
|
-
getTexImage2DFormat(): GLenum;
|
|
1870
1924
|
/**
|
|
1871
1925
|
* Creates a copy of the resources stored in this `MPMask`. You can
|
|
1872
1926
|
* invoke this method to extend the lifetime of a mask returned by a
|
|
1873
1927
|
* MediaPipe Task. Note that performance critical applications should aim to
|
|
1874
1928
|
* only use the `MPMask` within the MediaPipe Task callback so that
|
|
1875
1929
|
* copies can be avoided.
|
|
1930
|
+
*
|
|
1931
|
+
* @export
|
|
1876
1932
|
*/
|
|
1877
1933
|
clone(): MPMask;
|
|
1878
1934
|
/**
|
|
@@ -1882,6 +1938,8 @@ export declare class MPMask {
|
|
|
1882
1938
|
* Task, as these are freed automatically once you leave the MediaPipe
|
|
1883
1939
|
* callback. Additionally, some shared state is freed only once you invoke
|
|
1884
1940
|
* the Task's `close()` method.
|
|
1941
|
+
*
|
|
1942
|
+
* @export
|
|
1885
1943
|
*/
|
|
1886
1944
|
close(): void;
|
|
1887
1945
|
}
|
|
@@ -1947,11 +2005,14 @@ export declare interface NormalizedLandmark {
|
|
|
1947
2005
|
z: number;
|
|
1948
2006
|
}
|
|
1949
2007
|
|
|
1950
|
-
/**
|
|
2008
|
+
/**
|
|
2009
|
+
* Performs object detection on images.
|
|
2010
|
+
*/
|
|
1951
2011
|
export declare class ObjectDetector extends VisionTaskRunner {
|
|
1952
2012
|
/**
|
|
1953
2013
|
* Initializes the Wasm runtime and creates a new object detector from the
|
|
1954
2014
|
* provided options.
|
|
2015
|
+
* @export
|
|
1955
2016
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1956
2017
|
* Wasm binary and its loader.
|
|
1957
2018
|
* @param objectDetectorOptions The options for the Object Detector. Note that
|
|
@@ -1962,6 +2023,7 @@ export declare class ObjectDetector extends VisionTaskRunner {
|
|
|
1962
2023
|
/**
|
|
1963
2024
|
* Initializes the Wasm runtime and creates a new object detector based on the
|
|
1964
2025
|
* provided model asset buffer.
|
|
2026
|
+
* @export
|
|
1965
2027
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1966
2028
|
* Wasm binary and its loader.
|
|
1967
2029
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -1970,6 +2032,7 @@ export declare class ObjectDetector extends VisionTaskRunner {
|
|
|
1970
2032
|
/**
|
|
1971
2033
|
* Initializes the Wasm runtime and creates a new object detector based on the
|
|
1972
2034
|
* path to the model asset.
|
|
2035
|
+
* @export
|
|
1973
2036
|
* @param wasmFileset A configuration object that provides the location of the
|
|
1974
2037
|
* Wasm binary and its loader.
|
|
1975
2038
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -1983,6 +2046,7 @@ export declare class ObjectDetector extends VisionTaskRunner {
|
|
|
1983
2046
|
* You can reset an option back to its default value by explicitly setting it
|
|
1984
2047
|
* to `undefined`.
|
|
1985
2048
|
*
|
|
2049
|
+
* @export
|
|
1986
2050
|
* @param options The options for the object detector.
|
|
1987
2051
|
*/
|
|
1988
2052
|
setOptions(options: ObjectDetectorOptions): Promise<void>;
|
|
@@ -1991,6 +2055,7 @@ export declare class ObjectDetector extends VisionTaskRunner {
|
|
|
1991
2055
|
* synchronously for the response. Only use this method when the
|
|
1992
2056
|
* ObjectDetector is created with running mode `image`.
|
|
1993
2057
|
*
|
|
2058
|
+
* @export
|
|
1994
2059
|
* @param image An image to process.
|
|
1995
2060
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
1996
2061
|
* to process the input image before running inference.
|
|
@@ -2002,6 +2067,7 @@ export declare class ObjectDetector extends VisionTaskRunner {
|
|
|
2002
2067
|
* synchronously for the response. Only use this method when the
|
|
2003
2068
|
* ObjectDetector is created with running mode `video`.
|
|
2004
2069
|
*
|
|
2070
|
+
* @export
|
|
2005
2071
|
* @param videoFrame A video frame to process.
|
|
2006
2072
|
* @param timestamp The timestamp of the current frame, in ms.
|
|
2007
2073
|
* @param imageProcessingOptions the `ImageProcessingOptions` specifying how
|
|
@@ -2020,11 +2086,14 @@ export declare class PoseLandmarker extends VisionTaskRunner {
|
|
|
2020
2086
|
/**
|
|
2021
2087
|
* An array containing the pairs of pose landmark indices to be rendered with
|
|
2022
2088
|
* connections.
|
|
2089
|
+
* @export
|
|
2090
|
+
* @nocollapse
|
|
2023
2091
|
*/
|
|
2024
2092
|
static POSE_CONNECTIONS: Connection[];
|
|
2025
2093
|
/**
|
|
2026
2094
|
* Initializes the Wasm runtime and creates a new `PoseLandmarker` from the
|
|
2027
2095
|
* provided options.
|
|
2096
|
+
* @export
|
|
2028
2097
|
* @param wasmFileset A configuration object that provides the location of the
|
|
2029
2098
|
* Wasm binary and its loader.
|
|
2030
2099
|
* @param poseLandmarkerOptions The options for the PoseLandmarker.
|
|
@@ -2035,6 +2104,7 @@ export declare class PoseLandmarker extends VisionTaskRunner {
|
|
|
2035
2104
|
/**
|
|
2036
2105
|
* Initializes the Wasm runtime and creates a new `PoseLandmarker` based on
|
|
2037
2106
|
* the provided model asset buffer.
|
|
2107
|
+
* @export
|
|
2038
2108
|
* @param wasmFileset A configuration object that provides the location of the
|
|
2039
2109
|
* Wasm binary and its loader.
|
|
2040
2110
|
* @param modelAssetBuffer A binary representation of the model.
|
|
@@ -2043,6 +2113,7 @@ export declare class PoseLandmarker extends VisionTaskRunner {
|
|
|
2043
2113
|
/**
|
|
2044
2114
|
* Initializes the Wasm runtime and creates a new `PoseLandmarker` based on
|
|
2045
2115
|
* the path to the model asset.
|
|
2116
|
+
* @export
|
|
2046
2117
|
* @param wasmFileset A configuration object that provides the location of the
|
|
2047
2118
|
* Wasm binary and its loader.
|
|
2048
2119
|
* @param modelAssetPath The path to the model asset.
|
|
@@ -2056,6 +2127,7 @@ export declare class PoseLandmarker extends VisionTaskRunner {
|
|
|
2056
2127
|
* You can reset an option back to its default value by explicitly setting it
|
|
2057
2128
|
* to `undefined`.
|
|
2058
2129
|
*
|
|
2130
|
+
* @export
|
|
2059
2131
|
* @param options The options for the pose landmarker.
|
|
2060
2132
|
*/
|
|
2061
2133
|
setOptions(options: PoseLandmarkerOptions): Promise<void>;
|
|
@@ -2256,7 +2328,10 @@ declare abstract class TaskRunner {
|
|
|
2256
2328
|
protected constructor();
|
|
2257
2329
|
/** Configures the task with custom options. */
|
|
2258
2330
|
abstract setOptions(options: TaskRunnerOptions): Promise<void>;
|
|
2259
|
-
/**
|
|
2331
|
+
/**
|
|
2332
|
+
* Closes and cleans up the resources held by this task.
|
|
2333
|
+
* @export
|
|
2334
|
+
*/
|
|
2260
2335
|
close(): void;
|
|
2261
2336
|
}
|
|
2262
2337
|
|
|
@@ -2288,14 +2363,9 @@ declare interface VisionTaskOptions extends TaskRunnerOptions {
|
|
|
2288
2363
|
declare abstract class VisionTaskRunner extends TaskRunner {
|
|
2289
2364
|
protected constructor();
|
|
2290
2365
|
/**
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
* @param options The options for the task.
|
|
2294
|
-
* @param loadTfliteModel Whether to load the model specified in
|
|
2295
|
-
* `options.baseOptions`.
|
|
2366
|
+
* Closes and cleans up the resources held by this task.
|
|
2367
|
+
* @export
|
|
2296
2368
|
*/
|
|
2297
|
-
applyOptions(options: VisionTaskOptions, loadTfliteModel?: boolean): Promise<void>;
|
|
2298
|
-
/** Closes and cleans up the resources held by this task. */
|
|
2299
2369
|
close(): void;
|
|
2300
2370
|
}
|
|
2301
2371
|
|
|
@@ -2322,6 +2392,8 @@ declare interface WasmFileset {
|
|
|
2322
2392
|
wasmBinaryPath: string;
|
|
2323
2393
|
/** The optional path to the asset loader script. */
|
|
2324
2394
|
assetLoaderPath?: string;
|
|
2395
|
+
/** The optional path to the assets binary. */
|
|
2396
|
+
assetBinaryPath?: string;
|
|
2325
2397
|
}
|
|
2326
2398
|
|
|
2327
2399
|
export { }
|