@mediapipe/tasks-vision 0.10.21 → 0.10.32

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 CHANGED
@@ -39,21 +39,6 @@ const landmarks = faceLandmarker.detect(image);
39
39
 
40
40
  For more information, refer to the [Face Landmarker](https://developers.google.com/mediapipe/solutions/vision/face_landmarker/web_js) documentation.
41
41
 
42
- ## Face Stylizer
43
-
44
- The MediaPipe Face Stylizer lets you perform face stylization on images.
45
-
46
- ```
47
- const vision = await FilesetResolver.forVisionTasks(
48
- "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm"
49
- );
50
- const faceStylizer = await FaceStylizer.createFromModelPath(vision,
51
- "https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/1/blaze_face_stylizer.task"
52
- );
53
- const image = document.getElementById("image") as HTMLImageElement;
54
- const stylizedImage = faceStylizer.stylize(image);
55
- ```
56
-
57
42
  ## Gesture Recognizer
58
43
 
59
44
  The MediaPipe Gesture Recognizer task lets you recognize hand gestures in real
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-vision",
3
- "version": "0.10.21",
3
+ "version": "0.10.32",
4
4
  "description": "MediaPipe Vision Tasks",
5
5
  "main": "vision_bundle.cjs",
6
6
  "browser": "vision_bundle.mjs",
package/vision.d.ts CHANGED
@@ -699,133 +699,6 @@ export declare interface FaceLandmarkerResult {
699
699
  facialTransformationMatrixes: Matrix[];
700
700
  }
701
701
 
702
- /** Performs face stylization on images. */
703
- export declare class FaceStylizer extends VisionTaskRunner {
704
- /**
705
- * Initializes the Wasm runtime and creates a new Face Stylizer from the
706
- * provided options.
707
- * @export
708
- * @param wasmFileset A configuration object that provides the location of
709
- * the Wasm binary and its loader.
710
- * @param faceStylizerOptions The options for the Face Stylizer. Note
711
- * that either a path to the model asset or a model buffer needs to be
712
- * provided (via `baseOptions`).
713
- */
714
- static createFromOptions(wasmFileset: WasmFileset, faceStylizerOptions: FaceStylizerOptions): Promise<FaceStylizer>;
715
- /**
716
- * Initializes the Wasm runtime and creates a new Face Stylizer based on
717
- * the provided model asset buffer.
718
- * @export
719
- * @param wasmFileset A configuration object that provides the location of
720
- * the Wasm binary and its loader.
721
- * @param modelAssetBuffer An array or a stream containing a binary
722
- * representation of the model.
723
- */
724
- static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array | ReadableStreamDefaultReader): Promise<FaceStylizer>;
725
- /**
726
- * Initializes the Wasm runtime and creates a new Face Stylizer based on
727
- * the path to the model asset.
728
- * @export
729
- * @param wasmFileset A configuration object that provides the location of
730
- * the Wasm binary and its loader.
731
- * @param modelAssetPath The path to the model asset.
732
- */
733
- static createFromModelPath(wasmFileset: WasmFileset, modelAssetPath: string): Promise<FaceStylizer>;
734
- private constructor();
735
- /**
736
- * Sets new options for the Face Stylizer.
737
- *
738
- * Calling `setOptions()` with a subset of options only affects those
739
- * options. You can reset an option back to its default value by
740
- * explicitly setting it to `undefined`.
741
- *
742
- * @export
743
- * @param options The options for the Face Stylizer.
744
- */
745
- setOptions(options: FaceStylizerOptions): Promise<void>;
746
- /**
747
- * Performs face stylization on the provided single image and invokes the
748
- * callback with result. The method returns synchronously once the callback
749
- * returns. Only use this method when the FaceStylizer is created with the
750
- * image running mode.
751
- *
752
- * @param image An image to process.
753
- * @param callback The callback that is invoked with the stylized image or
754
- * `null` if no face was detected. The lifetime of the returned data is
755
- * only guaranteed for the duration of the callback.
756
- */
757
- stylize(image: ImageSource, callback: FaceStylizerCallback): void;
758
- /**
759
- * Performs face stylization on the provided single image and invokes the
760
- * callback with result. The method returns synchronously once the callback
761
- * returns. Only use this method when the FaceStylizer is created with the
762
- * image running mode.
763
- *
764
- * The 'imageProcessingOptions' parameter can be used to specify one or all
765
- * of:
766
- * - the rotation to apply to the image before performing stylization, by
767
- * setting its 'rotationDegrees' property.
768
- * - the region-of-interest on which to perform stylization, by setting its
769
- * 'regionOfInterest' property. If not specified, the full image is used.
770
- * If both are specified, the crop around the region-of-interest is extracted
771
- * first, then the specified rotation is applied to the crop.
772
- *
773
- * @param image An image to process.
774
- * @param imageProcessingOptions the `ImageProcessingOptions` specifying how
775
- * to process the input image before running inference.
776
- * @param callback The callback that is invoked with the stylized image or
777
- * `null` if no face was detected. The lifetime of the returned data is
778
- * only guaranteed for the duration of the callback.
779
- */
780
- stylize(image: ImageSource, imageProcessingOptions: ImageProcessingOptions, callback: FaceStylizerCallback): void;
781
- /**
782
- * Performs face stylization on the provided single image and returns the
783
- * result. This method creates a copy of the resulting image and should not be
784
- * used in high-throughput applications. Only use this method when the
785
- * FaceStylizer is created with the image running mode.
786
- *
787
- * @param image An image to process.
788
- * @return A stylized face or `null` if no face was detected. The result is
789
- * copied to avoid lifetime issues.
790
- */
791
- stylize(image: ImageSource): MPImage | null;
792
- /**
793
- * Performs face stylization on the provided single image and returns the
794
- * result. This method creates a copy of the resulting image and should not be
795
- * used in high-throughput applications. Only use this method when the
796
- * FaceStylizer is created with the image running mode.
797
- *
798
- * The 'imageProcessingOptions' parameter can be used to specify one or all
799
- * of:
800
- * - the rotation to apply to the image before performing stylization, by
801
- * setting its 'rotationDegrees' property.
802
- * - the region-of-interest on which to perform stylization, by setting its
803
- * 'regionOfInterest' property. If not specified, the full image is used.
804
- * If both are specified, the crop around the region-of-interest is extracted
805
- * first, then the specified rotation is applied to the crop.
806
- *
807
- * @param image An image to process.
808
- * @param imageProcessingOptions the `ImageProcessingOptions` specifying how
809
- * to process the input image before running inference.
810
- * @return A stylized face or `null` if no face was detected. The result is
811
- * copied to avoid lifetime issues.
812
- */
813
- stylize(image: ImageSource, imageProcessingOptions: ImageProcessingOptions): MPImage | null;
814
- }
815
-
816
- /**
817
- * A callback that receives an `MPImage` object from the face stylizer, or
818
- * `null` if no face was detected. The lifetime of the underlying data is
819
- * limited to the duration of the callback. If asynchronous processing is
820
- * needed, all data needs to be copied before the callback returns (via
821
- * `image.clone()`).
822
- */
823
- export declare type FaceStylizerCallback = (image: MPImage | null) => void;
824
-
825
- /** Options to configure the MediaPipe Face Stylizer Task */
826
- export declare interface FaceStylizerOptions extends VisionTaskOptions {
827
- }
828
-
829
702
  /**
830
703
  * Resolves the files required for the MediaPipe Task APIs.
831
704
  *
@@ -2080,7 +1953,7 @@ export declare class InteractiveSegmenter extends VisionTaskRunner {
2080
1953
  export declare type InteractiveSegmenterCallback = (result: InteractiveSegmenterResult) => void;
2081
1954
 
2082
1955
  /** Options to configure the MediaPipe Interactive Segmenter Task */
2083
- export declare interface InteractiveSegmenterOptions extends TaskRunnerOptions {
1956
+ export declare interface InteractiveSegmenterOptions extends VisionTaskOptions {
2084
1957
  /** Whether to output confidence masks. Defaults to true. */
2085
1958
  outputConfidenceMasks?: boolean | undefined;
2086
1959
  /** Whether to output the category masks. Defaults to false. */