deepar 5.0.0-alpha-1 → 5.0.0-alpha-2
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 +7 -3
- package/js/deepar.esm.js +1 -1
- package/js/deepar.js +1 -1
- package/js/types/DeepAR.d.ts +17 -4
- package/js/types/initParams.d.ts +44 -21
- package/js/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/wasm/deepar.wasm +0 -0
- package/wasm/tfjs-backend-wasm-simd.wasm +0 -0
- package/wasm/tfjs-backend-wasm-threaded-simd.wasm +0 -0
- package/wasm/tfjs-backend-wasm.wasm +0 -0
- package/js/types/footTrackingConfig.d.ts +0 -21
- package/js/types/platformDetect.d.ts +0 -17
- package/js/types/videoRecordingOptions.d.ts +0 -14
- package/js/types/wrapper.d.ts +0 -10
package/js/types/DeepAR.d.ts
CHANGED
|
@@ -99,11 +99,24 @@ export declare class DeepAR {
|
|
|
99
99
|
*/
|
|
100
100
|
finishVideoRecording(): Promise<Blob>;
|
|
101
101
|
/**
|
|
102
|
-
* Starts the camera preview. By default, the camera will be user facing.
|
|
103
|
-
*
|
|
104
|
-
* @param
|
|
102
|
+
* Starts the camera preview. By default, the camera will be user facing. The returned promise will resolve after the camera starts
|
|
103
|
+
* or it will reject if camera permission was denied.
|
|
104
|
+
* @param cameraOptions Camera options.
|
|
105
|
+
* @param cameraOptions.mirror Mirror the camera horizontally. True by default.
|
|
106
|
+
* @param cameraOptions.mediaStreamConstraints Options passed to MediaDevices.getUserMedia(). The default is the user facing camera.
|
|
107
|
+
* @param cameraOptions.cameraPermissionAsked Callback called when camera permission is asked.
|
|
108
|
+
* @param cameraOptions.cameraPermissionGranted Callback called when camera permission is granted.
|
|
109
|
+
*/
|
|
110
|
+
startCamera(cameraOptions?: {
|
|
111
|
+
mirror?: boolean;
|
|
112
|
+
mediaStreamConstraints?: MediaStreamConstraints;
|
|
113
|
+
cameraPermissionAsked: () => void;
|
|
114
|
+
cameraPermissionGranted: () => void;
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Stops the camera preview.
|
|
105
118
|
*/
|
|
106
|
-
|
|
119
|
+
stopCamera(): void;
|
|
107
120
|
/**
|
|
108
121
|
* Stops the camera preview or custom video preview set by {@link setVideoElement}.
|
|
109
122
|
*/
|
package/js/types/initParams.d.ts
CHANGED
|
@@ -16,85 +16,108 @@ export interface DeepARParams {
|
|
|
16
16
|
*/
|
|
17
17
|
effect?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Path to the root directory of the DeepAR SDK.
|
|
20
|
-
* For example "https://cdn.jsdelivr.net/npm/deepar@4.0.3/".<br>
|
|
19
|
+
* Path to the root directory of the DeepAR SDK. This path will be used to locate and download all the additional needed files like ML models and wasm files.
|
|
20
|
+
* By default, this points to the JsDelivr CDN. For example "https://cdn.jsdelivr.net/npm/deepar@4.0.3/".<br>
|
|
21
|
+
*
|
|
22
|
+
* If you want to host the DeepAR SDK yourself set the path to it here. It is recommended to host DeepAR SDK on your own since then you can use compressions like gzip and brotli on the files.
|
|
21
23
|
*
|
|
22
24
|
* > ⚠️ <b>Be sure that the version of DeepAR js file and the root SDK path match!</b>
|
|
23
25
|
*
|
|
24
|
-
* This path will be used to locate and download all the additional needed files like ML models.
|
|
25
26
|
* DeepAR SDK can be hosted on any other server, but be sure not to change the directory and file structure of DeepAR SDK when hosing it.<br>
|
|
26
27
|
*
|
|
27
28
|
* To configure usage of non-default ML models, define them in the {@link additionalOptions}.
|
|
28
29
|
*/
|
|
29
30
|
rootPath?: string;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* Additional DeepAR options.
|
|
32
33
|
*/
|
|
33
34
|
additionalOptions?: {
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* Camera options. DeepAR will use the camera by default.
|
|
36
37
|
*/
|
|
37
38
|
cameraConfig?: {
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* If true, DeepAR will not use camera preview by default and all the other options here are ignored in that case. You can use your own camera/video by calling {@link DeepAR.setVideoElement} or start the camera at any time by calling {@link DeepAR.startCamera}
|
|
41
|
+
*/
|
|
42
|
+
disableDefaultCamera?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Can be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. Default is "user".
|
|
40
45
|
*/
|
|
41
46
|
facingMode?: string;
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
48
|
+
* Called when the camera permission is asked.
|
|
44
49
|
*/
|
|
45
|
-
|
|
50
|
+
cameraPermissionAsked?: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Called when the camera permission is granted.
|
|
53
|
+
*/
|
|
54
|
+
cameraPermissionGranted?: () => void;
|
|
46
55
|
};
|
|
47
56
|
/**
|
|
48
57
|
* Provide a hint or hints to DeepAR to optimize the SDK in some scenarios. <br><br>
|
|
49
58
|
* Available hints:
|
|
50
59
|
* <ul>
|
|
51
|
-
* <li><b>
|
|
52
|
-
* <li><b>
|
|
53
|
-
* <li><b>
|
|
60
|
+
* <li><b>faceModelsPredownload</b> - Will download the face models as soon as possible.</li>
|
|
61
|
+
* <li><b>segmentationModelsPredownload</b> - Will download the segmentation models as soon as possible. Note - it will not try to initialize segmentation. Segmentation will be lazy loaded when needed.</li>
|
|
62
|
+
* <li><b>footModelsPredownload</b> - Will download the foot models as soon as possible. Note - it will not try to initialize foot tracking. Foot tracking will be lazy loaded when needed.</li>
|
|
63
|
+
* <li><b>segmentationInit</b> - Will initialize segmentation as soon as possible. Without this hint segmentation is lazy loaded when some segmentation effect is loaded.</li>
|
|
64
|
+
* <li><b>footInit</b> - Will initialize foot tracking as soon as possible. Without this hint foot tracking is lazy loaded when some foot tracking effect is loaded.</li>
|
|
54
65
|
* </ul>
|
|
55
66
|
*/
|
|
56
67
|
hint?: string | string[];
|
|
57
68
|
/**
|
|
58
|
-
*
|
|
69
|
+
* Face tracking module path and options.
|
|
59
70
|
*/
|
|
60
71
|
faceTrackingConfig?: {
|
|
61
72
|
/**
|
|
62
|
-
*
|
|
73
|
+
* Path to the face tracking model. Something like "path/to/deepar/models/face/models-68-extreme.bin".
|
|
63
74
|
*/
|
|
64
75
|
modelPath: string;
|
|
65
76
|
};
|
|
66
77
|
/**
|
|
67
|
-
*
|
|
78
|
+
* Segmentation module path and options.
|
|
68
79
|
*/
|
|
69
80
|
segmentationConfig?: {
|
|
70
81
|
/**
|
|
71
|
-
* Path to the segmentation model. Something like "path/to/segmentation-192x192.bin".
|
|
82
|
+
* Path to the segmentation model. Something like "path/to/deepar/models/segmentation/segmentation-192x192.bin".
|
|
72
83
|
*/
|
|
73
84
|
modelPath: string;
|
|
74
85
|
};
|
|
75
86
|
/**
|
|
76
|
-
*
|
|
87
|
+
* Foot tracking module paths and options.
|
|
77
88
|
*/
|
|
78
89
|
footTrackingConfig?: {
|
|
79
90
|
/**
|
|
80
|
-
* Path to the pose
|
|
91
|
+
* Path to the pose libPoseEstimation.wasm file, e.g. "/path/to/deepar/wasm/libPoseEstimation.wasm".
|
|
81
92
|
*/
|
|
82
93
|
poseEstimationWasmPath?: string;
|
|
83
94
|
/**
|
|
84
|
-
* Path to the detector model, e.g. "/path/to/foot-detector
|
|
95
|
+
* Path to the detector model, e.g. "/path/to/deepar/models/foot/foot-detector.bin".
|
|
85
96
|
*/
|
|
86
97
|
detectorPath?: string;
|
|
87
98
|
/**
|
|
88
|
-
* Path to the tracker model, e.g. "/path/to/foot-tracker
|
|
99
|
+
* Path to the tracker model, e.g. "/path/to/deepar/models/foot/foot-tracker.bin".
|
|
89
100
|
*/
|
|
90
101
|
trackerPath?: string;
|
|
91
102
|
/**
|
|
92
|
-
* Path to the foot model object file, e.g. "/path/to/foot-model.obj".
|
|
103
|
+
* Path to the foot model object file, e.g. "/path/to/deepar/models/foot/foot-model.obj".
|
|
93
104
|
*/
|
|
94
105
|
objPath?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Path to tfjs-backend-wasm.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm.wasm"
|
|
108
|
+
*/
|
|
109
|
+
tfjsBackendWasmPath?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Path to tfjs-backend-wasm-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-simd.wasm"
|
|
112
|
+
*/
|
|
113
|
+
tfjsBackendWasmSimdPath?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Path to tfjs-backend-wasm-threaded-simd.wasm file, e.g. "path/to/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm"
|
|
116
|
+
*/
|
|
117
|
+
tfjsBackendWasmThreadedSimdPath?: string;
|
|
95
118
|
};
|
|
96
119
|
/**
|
|
97
|
-
* Path to deepar.wasm file. Something like "path/to/deepar.wasm".
|
|
120
|
+
* Path to deepar.wasm file. Something like "/path/to/deepar/wasm/deepar.wasm".
|
|
98
121
|
*/
|
|
99
122
|
deeparWasmPath?: string;
|
|
100
123
|
};
|
package/js/types/version.d.ts
CHANGED
package/package.json
CHANGED
package/wasm/deepar.wasm
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Foot tracking initialization parameters.
|
|
3
|
-
*/
|
|
4
|
-
export interface DeepARFootTrackingConfig {
|
|
5
|
-
/**
|
|
6
|
-
* Path to the pose estimation wasm file, e.g. "/path/to/libPoseEstimation.wasm".
|
|
7
|
-
*/
|
|
8
|
-
poseEstimationWasmPath?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Path to the detector model, e.g. "/path/to/foot-detector-ios.bin".
|
|
11
|
-
*/
|
|
12
|
-
detectorPath?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Path to the tracker model, e.g. "/path/to/foot-tracker-ios.bin".
|
|
15
|
-
*/
|
|
16
|
-
trackerPath?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Path to the foot model object file, e.g. "/path/to/foot-model.obj".
|
|
19
|
-
*/
|
|
20
|
-
objPath?: string;
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare const gui: boolean;
|
|
2
|
-
declare const terminal: boolean;
|
|
3
|
-
declare const node: boolean;
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
MSStream: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
declare const android: boolean;
|
|
10
|
-
declare const chromeos: boolean;
|
|
11
|
-
declare const tizen: boolean;
|
|
12
|
-
declare const ios: boolean;
|
|
13
|
-
declare const linuxBased: boolean;
|
|
14
|
-
declare const windows: boolean;
|
|
15
|
-
declare const macos: boolean;
|
|
16
|
-
declare const linux: boolean;
|
|
17
|
-
export { gui, terminal, node, android, chromeos, tizen, ios, linuxBased, windows, macos, linux, };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parameters that specify the format of recorded videos. Used by {@link DeepAR.startVideoRecording}.
|
|
3
|
-
*/
|
|
4
|
-
export interface VideoRecordingOptions {
|
|
5
|
-
/**
|
|
6
|
-
* A MIME type specyfing the format for the resulting video, such as `video/webm` or `video/mp4`.
|
|
7
|
-
* Corresponds to the MIME type used by <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a>
|
|
8
|
-
* objects and <a href="https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder">MediaRecorder</a>
|
|
9
|
-
* from the MediaStream Recording API.
|
|
10
|
-
*
|
|
11
|
-
* Note that `video/mp4` may not be supported in all browsers.
|
|
12
|
-
*/
|
|
13
|
-
mimeType?: string;
|
|
14
|
-
}
|
package/js/types/wrapper.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './version';
|
|
2
|
-
export * from './DeepAR';
|
|
3
|
-
export * from './initParams';
|
|
4
|
-
export * from './callbacks';
|
|
5
|
-
export * from './footTrackingConfig';
|
|
6
|
-
export * from './faceData';
|
|
7
|
-
export * from './footData';
|
|
8
|
-
export * from './videoRecordingOptions';
|
|
9
|
-
export * from './touchType';
|
|
10
|
-
export * from './logType';
|