@vonage/ml-transformers 4.3.4 → 4.3.6

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.
Files changed (47) hide show
  1. package/dist/ml-transformers.es.js +7970 -8309
  2. package/dist/ml-transformers.min.js +3 -3
  3. package/dist/ml-transformers.static.js +7970 -8309
  4. package/dist/ml-transformers.umd.js +62 -63
  5. package/dist/types/{main.d.ts → lib/main.d.ts} +1 -1
  6. package/dist/types/{src → lib/src}/facades/vonage-media-processor.d.ts +3 -0
  7. package/dist/types/{src → lib/src}/filters/background-filter.d.ts +0 -0
  8. package/dist/types/{src → lib/src}/filters/resize-filter.d.ts +0 -0
  9. package/dist/types/{src → lib/src}/processors/processor-main.d.ts +0 -0
  10. package/dist/types/{src → lib/src}/processors/processor-worker.d.ts +1 -1
  11. package/dist/types/{src → lib/src}/transformers/background-transformer.d.ts +4 -0
  12. package/dist/types/{src → lib/src}/types.d.ts +16 -10
  13. package/dist/types/{src → lib/src}/utils/assets-loader.d.ts +0 -0
  14. package/dist/types/{src → lib/src}/utils/async.d.ts +0 -0
  15. package/dist/types/{src → lib/src}/utils/error.d.ts +0 -0
  16. package/dist/types/{src → lib/src}/utils/mediapipe.d.ts +0 -0
  17. package/dist/types/{src → lib/src}/utils/support.d.ts +0 -0
  18. package/dist/types/{src → lib/src}/utils/webgl.d.ts +0 -2
  19. package/dist/types/{src → lib/src}/wasm/selfie-segmentation/loader.d.ts +0 -0
  20. package/dist/types/{src → lib/src}/wasm/selfie-segmentation/wrapper.d.ts +0 -0
  21. package/dist/types/{src → lib/src}/webgl/pipelines/background-blur.d.ts +0 -0
  22. package/dist/types/{src → lib/src}/webgl/pipelines/background-image.d.ts +0 -0
  23. package/dist/types/{src → lib/src}/webgl/pipelines/background-video.d.ts +0 -0
  24. package/dist/types/{src → lib/src}/webgl/pipelines/foreground-blur.d.ts +0 -0
  25. package/dist/types/{src → lib/src}/webgl/pipelines/improve-segmentation-mask.d.ts +0 -0
  26. package/dist/types/{src → lib/src}/webgl/pipelines/output-mask.d.ts +0 -0
  27. package/dist/types/{src → lib/src}/webgl/pipelines/resize-image.d.ts +0 -0
  28. package/dist/types/{src → lib/src}/webgl/programs/blur/blur.d.ts +0 -0
  29. package/dist/types/{src → lib/src}/webgl/programs/blur-masked/blur-masked.d.ts +0 -0
  30. package/dist/types/{src → lib/src}/webgl/programs/expend/expend.d.ts +0 -0
  31. package/dist/types/{src → lib/src}/webgl/programs/flickering/flickering.d.ts +0 -0
  32. package/dist/types/{src → lib/src}/webgl/programs/highpass/highpass.d.ts +0 -0
  33. package/dist/types/{src → lib/src}/webgl/programs/joint-bilateral/joint-bilateral.d.ts +0 -0
  34. package/dist/types/{src → lib/src}/webgl/programs/minimum-surface/minimum-surface.d.ts +0 -0
  35. package/dist/types/{src → lib/src}/webgl/programs/mix/mix.d.ts +0 -0
  36. package/dist/types/{src → lib/src}/webgl/programs/power/power.d.ts +0 -0
  37. package/dist/types/{src → lib/src}/webgl/programs/refine-mask/refine-mask.d.ts +0 -0
  38. package/dist/types/{src → lib/src}/webgl/programs/render-texture/render-texture.d.ts +0 -0
  39. package/dist/types/{src → lib/src}/webgl/programs/smooth/smooth.d.ts +0 -0
  40. package/dist/types/{src → lib/src}/webgl/programs/track/track.d.ts +0 -0
  41. package/dist/types/{src → lib/src}/webgl/webgl-pipeline-program-double-buffer.d.ts +0 -0
  42. package/dist/types/{src → lib/src}/webgl/webgl-pipeline-program.d.ts +0 -0
  43. package/dist/types/{src → lib/src}/webgl/webgl-pipeline.d.ts +0 -0
  44. package/dist/types/{src → lib/src}/webgl/webgl-profiler-reporter.d.ts +0 -0
  45. package/dist/types/{src → lib/src}/webgl/webgl-profiler.d.ts +0 -0
  46. package/dist/types/{src → lib/src}/webgl/webgl-transormer-pipeline.d.ts +0 -0
  47. package/package.json +5 -4
@@ -124,7 +124,7 @@ declare function getVonagePose(): VonagePose;
124
124
  /**
125
125
  * MediaProcessorConfig specifies the transformer logic to be performed.
126
126
  */
127
- declare type MediaProcessorConfig = BackgroundOptions;
127
+ type MediaProcessorConfig = BackgroundOptions;
128
128
  /**
129
129
  * builder function to create MediaProcessor
130
130
  * @param config - see `MediaProcessorConfig` definition
@@ -53,6 +53,9 @@ export declare class VonageMediaProcessor extends Emittery<EventDataMap> {
53
53
  */
54
54
  getConnector(): MediaProcessorConnector;
55
55
  profile(duration: number): Promise<ResolvedWebglQuery[]>;
56
+ /**
57
+ * @internal
58
+ */
56
59
  static profile(duration: number): Promise<WebglProfilerReporter>;
57
60
  private static instances;
58
61
  /**
@@ -3,7 +3,7 @@ import { BackgroundOptions, MediaProcessorConfig } from "../../main";
3
3
  import { FlickeringOptions } from "../webgl/pipelines/improve-segmentation-mask";
4
4
  export interface MediaProcessorEvent {
5
5
  name: keyof EventDataMap;
6
- data: WarnData | ErrorData | PipelineInfoData;
6
+ data?: WarnData | ErrorData | PipelineInfoData;
7
7
  }
8
8
  export declare class ProcessorWorker {
9
9
  private backgroundTransformer;
@@ -5,12 +5,16 @@ import { ResolvedWebglQuery } from "../webgl/webgl-profiler";
5
5
  export declare class BackgroundTransformer {
6
6
  private selfieSegmentation;
7
7
  private backgroundFilter?;
8
+ private reporter;
8
9
  init(id: string, config: MediaProcessorConfig): Promise<void>;
9
10
  private previousDimensions;
10
11
  transform?(frame: VideoFrame, controller: TransformStreamDefaultController): Promise<void>;
12
+ private backgroundOptions?;
11
13
  setBackgroundOptions(options: BackgroundOptions): Promise<void>;
12
14
  setVideoBGReadable(stream: ReadableStream): Promise<void>;
13
15
  setVirtualBGImage(image: ImageBitmap): Promise<void>;
14
16
  setFlickeringOptions(options: FlickeringOptions): void;
15
17
  profile(duration: number): Promise<ResolvedWebglQuery[]>;
18
+ getTransformerType(): string;
19
+ private report;
16
20
  }
@@ -46,7 +46,13 @@ export declare enum BackgroundTransformerType {
46
46
  * Precise avoid glitches and flickering, but is most costly
47
47
  */
48
48
  export declare enum SelfieSegmentationType {
49
+ /**
50
+ * No selfie segmentation post-processing. It might produce flickering and has low impact on performance.
51
+ */
49
52
  FAST = "FAST",
53
+ /**
54
+ * Enable selfie segmentation post-processing. It reduces flickering and glitches, however it might have some impact on performance.
55
+ */
50
56
  PRECISE = "PRECISE"
51
57
  }
52
58
  /**
@@ -137,22 +143,22 @@ export interface SilhouetteBlurConfig extends MediaProcessorBaseConfig {
137
143
  /**
138
144
  * BackgroundOptions background options
139
145
  */
140
- export declare type BackgroundOptions = BackgroundBlurConfig | VirtualBackgroundConfig | VideoBackgroundConfig | SilhouetteBlurConfig;
146
+ export type BackgroundOptions = BackgroundBlurConfig | VirtualBackgroundConfig | VideoBackgroundConfig | SilhouetteBlurConfig;
141
147
  export type { FaceDetectionResults, FaceDetectionOptions, FaceMeshResults, FaceMeshOptions, HandsResults, HandsOptions, HolisticResults, HolisticOptions, ObjectronResults, ObjectronOptions, SelfieSegmentationResults, SelfieSegmentationOptions, PoseResults, PoseOptions, };
142
148
  /**
143
149
  * MediaPipeResults types of results object of MediaPipe
144
150
  */
145
- export declare type MediaPipeResults = FaceDetectionResults | FaceMeshResults | HandsResults | HolisticResults | ObjectronResults | SelfieSegmentationResults | PoseResults;
151
+ export type MediaPipeResults = FaceDetectionResults | FaceMeshResults | HandsResults | HolisticResults | ObjectronResults | SelfieSegmentationResults | PoseResults;
146
152
  /**
147
153
  * ResultsListener callback function from MediaPipe process
148
154
  * @results - The results object from MediaPipe
149
155
  * @returns - can return a promise of void
150
156
  */
151
- export declare type MediaPipeResultsListener = <T extends MediaPipeResults>(results: T) => Promise<void> | void;
157
+ export type MediaPipeResultsListener = <T extends MediaPipeResults>(results: T) => Promise<void> | void;
152
158
  /**
153
159
  * MediaPipeModelType supported models types
154
160
  */
155
- export declare type MediaPipeModelType = "face_mesh" | "face_detection" | "hands" | "holistic" | "objectron" | "selfie_segmentation" | "pose";
161
+ export type MediaPipeModelType = "face_mesh" | "face_detection" | "hands" | "holistic" | "objectron" | "selfie_segmentation" | "pose";
156
162
  /**
157
163
  * defines one mediapipe model config
158
164
  * @modelType - which model is required
@@ -163,7 +169,7 @@ export declare type MediaPipeModelType = "face_mesh" | "face_detection" | "hands
163
169
  * please keep in mind that the assets list can change between versions!
164
170
  * assets are different between mediapipe models.
165
171
  */
166
- export declare type MediaPipeModelConfig = {
172
+ export type MediaPipeModelConfig = {
167
173
  modelType: MediaPipeModelType;
168
174
  listener: MediaPipeResultsListener;
169
175
  options: FaceDetectionOptions | FaceMeshOptions | HandsOptions | HolisticOptions | ObjectronOptions | SelfieSegmentationOptions | PoseOptions;
@@ -174,29 +180,29 @@ export declare type MediaPipeModelConfig = {
174
180
  * this structure allows the user to create few mediapipe models that will run in parallel.
175
181
  * @modelTypesArray - array of mediapipe models to be loaded and called.
176
182
  */
177
- export declare type MediapipeConfig = {
183
+ export type MediapipeConfig = {
178
184
  mediaPipeModelConfigArray: Array<MediaPipeModelConfig>;
179
185
  };
180
186
  /**
181
187
  * Vector containing 3 numbers
182
188
  * @internal
183
189
  */
184
- export declare type vec3 = [number, number, number];
190
+ export type vec3 = [number, number, number];
185
191
  /**
186
192
  * Vector containing 4 numbers
187
193
  * @internal
188
194
  */
189
- export declare type vec4 = [number, number, number, number];
195
+ export type vec4 = [number, number, number, number];
190
196
  /**
191
197
  * Valid data to feed webgl texture
192
198
  * @internal
193
199
  */
194
- export declare type TextureSource = string | number[] | ArrayBufferView | TexImageSource | TexImageSource[] | string[] | TextureFunc | undefined;
200
+ export type TextureSource = string | number[] | ArrayBufferView | TexImageSource | TexImageSource[] | string[] | TextureFunc | undefined;
195
201
  /**
196
202
  * Valid uniform data map
197
203
  * @internal
198
204
  */
199
- export declare type UniformDataMap = {
205
+ export type UniformDataMap = {
200
206
  [key: string]: number | number[] | WebGLTexture;
201
207
  };
202
208
  /**
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,4 @@
1
1
  /// <reference types="dom-webcodecs" />
2
- /// <reference types="dom-webcodecs" />
3
- /// <reference types="offscreencanvas" />
4
2
  import { TextureSource, vec4 } from "../types";
5
3
  /**
6
4
  * Render a VideoFrame within a canvas
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonage/ml-transformers",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "author": "Guy Mininberg <guy.mininberg@vonage.com>",
5
5
  "contributors": [
6
6
  "Guy Mininberg <guy.mininberg@vonage.com>",
@@ -49,8 +49,9 @@
49
49
  "@types/emscripten": "^1.39.6",
50
50
  "@types/node": "^17.0.10",
51
51
  "@types/offscreencanvas": "^2019.6.4",
52
- "@vonage/js-workerizer": "^1.0.1",
53
- "@vonage/media-processor": "2.0.0",
52
+ "@vonage/js-onewebrtc-telemetry": "1.1.1",
53
+ "@vonage/js-workerizer": "^1.1.1",
54
+ "@vonage/media-processor": "2.0.2",
54
55
  "axios": "^0.25.0",
55
56
  "twgl.js": "^5.1.0",
56
57
  "typescript-optional": "3.0.0-alpha.3",
@@ -60,7 +61,7 @@
60
61
  "files": [
61
62
  "dist"
62
63
  ],
63
- "types": "./dist/types/main.d.ts",
64
+ "types": "./dist/types/lib/main.d.ts",
64
65
  "main": "./dist/ml-transformers.umd.js",
65
66
  "module": "./dist/ml-transformers.es.js",
66
67
  "exports": {