@vonage/ml-transformers 3.1.1 → 3.2.0
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/dist/docs/assets/highlight.css +14 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/classes/MediapipeHelper.html +1 -1
- package/dist/docs/classes/VonageMediaProcessor.html +106 -0
- package/dist/docs/enums/BlurRadius.html +1 -1
- package/dist/docs/index.html +1 -1
- package/dist/docs/interfaces/FaceDetectionOptions.html +1 -1
- package/dist/docs/interfaces/FaceDetectionResults.html +1 -1
- package/dist/docs/interfaces/FaceMeshOptions.html +1 -1
- package/dist/docs/interfaces/FaceMeshResults.html +1 -1
- package/dist/docs/interfaces/HandsOptions.html +1 -1
- package/dist/docs/interfaces/HandsResults.html +1 -1
- package/dist/docs/interfaces/HolisticOptions.html +1 -1
- package/dist/docs/interfaces/HolisticResults.html +1 -1
- package/dist/docs/interfaces/ObjectronOptions.html +1 -1
- package/dist/docs/interfaces/ObjectronResults.html +1 -1
- package/dist/docs/interfaces/PoseOptions.html +1 -1
- package/dist/docs/interfaces/PoseResults.html +1 -1
- package/dist/docs/interfaces/SelfieSegmentationOptions.html +1 -1
- package/dist/docs/interfaces/SelfieSegmentationResults.html +1 -1
- package/dist/docs/modules.html +11 -7
- package/dist/ml-transformers.es.js +673 -656
- package/dist/ml-transformers.umd.js +21 -21
- package/dist/types/main.d.ts +41 -35
- package/dist/types/src/vonage/VonageMediaProcessor.d.ts +59 -0
- package/package.json +1 -1
package/dist/types/main.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventDataMap, MediaProcessorConnectorInterface } from
|
|
2
|
-
import { BlurRadius, BackgroundBlurConfig, VirtualBackgroundConfig, AssetBackgroundConfig, VideoBackgroundConfig, MediaProcessorBaseConfig, SilueteBlurConfig, MediapipeConfig, MediaPipeResults, MediaPipeResultsListener, MediaPipeModelType, FaceDetectionResults, FaceDetectionOptions, FaceMeshResults, FaceMeshOptions, HandsResults, HandsOptions, HolisticResults, HolisticOptions, ObjectronResults, ObjectronOptions, PoseResults, PoseOptions, SelfieSegmentationResults, SelfieSegmentationOptions, MediaPipeModelConfig } from
|
|
3
|
-
import { isSupported } from
|
|
4
|
-
import Emittery from
|
|
5
|
-
import MediapipeHelper from
|
|
1
|
+
import { EventDataMap, MediaProcessorConnectorInterface } from "@vonage/media-processor";
|
|
2
|
+
import { BlurRadius, BackgroundBlurConfig, VirtualBackgroundConfig, AssetBackgroundConfig, VideoBackgroundConfig, MediaProcessorBaseConfig, SilueteBlurConfig, MediapipeConfig, MediaPipeResults, MediaPipeResultsListener, MediaPipeModelType, FaceDetectionResults, FaceDetectionOptions, FaceMeshResults, FaceMeshOptions, HandsResults, HandsOptions, HolisticResults, HolisticOptions, ObjectronResults, ObjectronOptions, PoseResults, PoseOptions, SelfieSegmentationResults, SelfieSegmentationOptions, MediaPipeModelConfig } from "./src/types";
|
|
3
|
+
import { isSupported } from "./src/utils/utils";
|
|
4
|
+
import Emittery from "emittery";
|
|
5
|
+
import MediapipeHelper from "./src/transformers/MediapipeHelper";
|
|
6
6
|
/**
|
|
7
7
|
* Vonage Mediapipe objects info (it will be used by the @mediapipe/drawing_utils package which is not included by this library).
|
|
8
8
|
* @param VonageSelfiesegmentation:
|
|
@@ -64,13 +64,14 @@ import MediapipeHelper from './src/transformers/MediapipeHelper';
|
|
|
64
64
|
* - POSE_LANDMARKS_RIGHT
|
|
65
65
|
* - POSE_LANDMARKS_NEUTRAL
|
|
66
66
|
*/
|
|
67
|
-
import VonageSelfiesegmentation from
|
|
68
|
-
import VonageHands from
|
|
69
|
-
import VonageHolistic from
|
|
70
|
-
import VonageFacedetection from
|
|
71
|
-
import VonageFacemash from
|
|
72
|
-
import VonageObjectron from
|
|
73
|
-
import VonagePose from
|
|
67
|
+
import VonageSelfiesegmentation from "./src/transformers/SelfieSegmentationHelper";
|
|
68
|
+
import VonageHands from "./src/transformers/HandsHelper";
|
|
69
|
+
import VonageHolistic from "./src/transformers/HolisticHelper";
|
|
70
|
+
import VonageFacedetection from "./src/transformers/FaceDetectionHelper";
|
|
71
|
+
import VonageFacemash from "./src/transformers/FaceMashHelper";
|
|
72
|
+
import VonageObjectron from "./src/transformers/ObjectronHelper";
|
|
73
|
+
import VonagePose from "./src/transformers/PoseHelper";
|
|
74
|
+
import { VonageMediaProcessor } from "./src/vonage/VonageMediaProcessor";
|
|
74
75
|
/**
|
|
75
76
|
* BackgroundOptions background options
|
|
76
77
|
*/
|
|
@@ -110,37 +111,42 @@ declare type BackgroundOptions = BackgroundBlurConfig | ((VirtualBackgroundConfi
|
|
|
110
111
|
* ```
|
|
111
112
|
*/
|
|
112
113
|
declare type MediaProcessorConfig = MediaProcessorBaseConfig & BackgroundOptions;
|
|
114
|
+
export declare function createVonageMediaProcessor(config: MediaProcessorConfig): Promise<VonageMediaProcessor>;
|
|
113
115
|
/**
|
|
114
116
|
* Registers for error and warn events that come from the library on run time.
|
|
115
117
|
* see @EventDataMap for more info.
|
|
118
|
+
* @deprecated Use the function {@link createMediaProcessor} to instantiate a processor directly.
|
|
116
119
|
*/
|
|
117
120
|
declare function getVonageEventEmitter(): Emittery<EventDataMap>;
|
|
118
121
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
* Sets the expected rate of the track per second.
|
|
123
|
+
* The media processor will use this number for calculating drops in the rate.
|
|
124
|
+
* This could happen when the transformation will take more time than expected.
|
|
125
|
+
* This will not cause an error, just warning to the client.
|
|
126
|
+
* Mostly:
|
|
127
|
+
* Video: 30 frames per second
|
|
128
|
+
* Audio: 50 audio data per second for OPUS
|
|
129
|
+
* @deprecated Use the function {@link createMediaProcessor} to instantiate a processor directly.
|
|
130
|
+
* @param trackExpectedRate - number holds the predicted track rate. -1 for disable this monitor.
|
|
131
|
+
*/
|
|
128
132
|
declare function setTrackExpectedRate(trackExpectedRate: number): void;
|
|
129
133
|
/**
|
|
130
|
-
* builder function to create MediaProcessorConnectorInterface
|
|
131
|
-
* This function hides all the functionality of the @vonage/media-processor library.
|
|
132
|
-
* using this create function promises the user the best performance of background operations.
|
|
133
|
-
* @
|
|
134
|
-
* @
|
|
135
|
-
|
|
134
|
+
* builder function to create MediaProcessorConnectorInterface
|
|
135
|
+
* This function hides all the functionality of the @vonage/media-processor library.
|
|
136
|
+
* using this create function promises the user the best performance of background operations.
|
|
137
|
+
* @deprecated Use the function {@link createMediaProcessor} to instantiate a processor directly.
|
|
138
|
+
* @param config - see `MediaProcessorConfig` definition
|
|
139
|
+
* @returns - `MediaProcessorConnectorInterface` feed this return value to any vonage SDK that supports this API
|
|
140
|
+
*/
|
|
136
141
|
declare function createVonageMediaProcessorConnector(config: MediaProcessorConfig): Promise<MediaProcessorConnectorInterface>;
|
|
137
142
|
/**
|
|
138
|
-
* change the background option during run time using this function.
|
|
139
|
-
* while using this function the media-processor will not be destroyed.
|
|
140
|
-
* while using this function the library promise a full resource cleanup.
|
|
141
|
-
* @
|
|
142
|
-
* @
|
|
143
|
-
|
|
143
|
+
* change the background option during run time using this function.
|
|
144
|
+
* while using this function the media-processor will not be destroyed.
|
|
145
|
+
* while using this function the library promise a full resource cleanup.
|
|
146
|
+
* @deprecated Use the function {@link createMediaProcessor} to instantiate a processor directly.
|
|
147
|
+
* @param backgroundOptions - see `BackgroundOptions` definition
|
|
148
|
+
* @returns - Promise<void>
|
|
149
|
+
*/
|
|
144
150
|
declare function setBackgroundOptions(backgroundOptions: BackgroundOptions): Promise<void>;
|
|
145
|
-
export type { MediaProcessorBaseConfig, BackgroundBlurConfig, VirtualBackgroundConfig, VideoBackgroundConfig, AssetBackgroundConfig, SilueteBlurConfig, MediaProcessorConfig, BackgroundOptions, MediapipeConfig, MediaPipeResults, MediaPipeModelType, MediaPipeResultsListener, FaceDetectionResults, FaceDetectionOptions, FaceMeshResults, FaceMeshOptions, HandsResults, HandsOptions, HolisticResults, HolisticOptions, ObjectronResults, ObjectronOptions, SelfieSegmentationOptions, SelfieSegmentationResults, PoseResults, PoseOptions, MediaPipeModelConfig };
|
|
146
|
-
export { BlurRadius, createVonageMediaProcessorConnector, getVonageEventEmitter, setTrackExpectedRate, isSupported, MediapipeHelper, setBackgroundOptions, VonageSelfiesegmentation, VonageFacedetection, VonageFacemash, VonageHands, VonageHolistic, VonageObjectron, VonagePose };
|
|
151
|
+
export type { MediaProcessorBaseConfig, BackgroundBlurConfig, VirtualBackgroundConfig, VideoBackgroundConfig, AssetBackgroundConfig, SilueteBlurConfig, MediaProcessorConfig, BackgroundOptions, MediapipeConfig, MediaPipeResults, MediaPipeModelType, MediaPipeResultsListener, FaceDetectionResults, FaceDetectionOptions, FaceMeshResults, FaceMeshOptions, HandsResults, HandsOptions, HolisticResults, HolisticOptions, ObjectronResults, ObjectronOptions, SelfieSegmentationOptions, SelfieSegmentationResults, PoseResults, PoseOptions, MediaPipeModelConfig, };
|
|
152
|
+
export { VonageMediaProcessor, BlurRadius, createVonageMediaProcessorConnector, getVonageEventEmitter, setTrackExpectedRate, isSupported, MediapipeHelper, setBackgroundOptions, VonageSelfiesegmentation, VonageFacedetection, VonageFacemash, VonageHands, VonageHolistic, VonageObjectron, VonagePose, };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EventDataMap, MediaProcessorConnector } from "@vonage/media-processor";
|
|
2
|
+
import Emittery from "emittery";
|
|
3
|
+
import { BackgroundOptions, MediaProcessorConfig } from "../../main";
|
|
4
|
+
/**
|
|
5
|
+
* Class wrapping features provided by ml-transformers.
|
|
6
|
+
*/
|
|
7
|
+
export declare class VonageMediaProcessor extends Emittery<EventDataMap> {
|
|
8
|
+
/**
|
|
9
|
+
* Web worker wrapper used to run the transformers
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
private worker;
|
|
13
|
+
/**
|
|
14
|
+
* Usable connector for media-processor lib
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
private connector;
|
|
18
|
+
/**
|
|
19
|
+
* Private constructor
|
|
20
|
+
* Use {@link create} to instantiate the class
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
private constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the processor worker an events
|
|
26
|
+
* @param config Configuration to initialize with
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
private init;
|
|
30
|
+
/**
|
|
31
|
+
* change the background option during run time using this function.
|
|
32
|
+
* while using this function the media-processor will not be destroyed.
|
|
33
|
+
* while using this function the library promise a full resource cleanup.
|
|
34
|
+
* @param backgroundOptions - see `BackgroundOptions` definition
|
|
35
|
+
*/
|
|
36
|
+
setBackgroundOptions(options: BackgroundOptions): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the expected rate of the track per second.
|
|
39
|
+
* The media processor will use this number for calculating drops in the rate.
|
|
40
|
+
* This could happen when the transformation will take more time than expected.
|
|
41
|
+
* This will not cause an error, just warning to the client.
|
|
42
|
+
* Mostly:
|
|
43
|
+
* Video: 30 frames per second
|
|
44
|
+
* Audio: 50 audio data per second for OPUS
|
|
45
|
+
* @param rate - number holds the predicted track rate. -1 for disable this monitor.
|
|
46
|
+
*/
|
|
47
|
+
setTrackExpectedRate(rate: number): void;
|
|
48
|
+
/**
|
|
49
|
+
* Getter for MediaProcessorConnectorInterface connector attribute.
|
|
50
|
+
* @returns - `MediaProcessorConnectorInterface` feed this return value to any vonage SDK that supports this API
|
|
51
|
+
*/
|
|
52
|
+
getConnector(): MediaProcessorConnector;
|
|
53
|
+
/**
|
|
54
|
+
* Asynchronous constructor of VonageMediaProcessor
|
|
55
|
+
* @param config Initial MediaProcessorConfig to use
|
|
56
|
+
* @returns Promise resolved with an initialized MediaProcessorConfig
|
|
57
|
+
*/
|
|
58
|
+
static create(config: MediaProcessorConfig): Promise<VonageMediaProcessor>;
|
|
59
|
+
}
|