shopar-plugin 0.7.4-alpha.1 → 0.7.4-alpha.3

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 (68) hide show
  1. package/dist/deepar/LICENSE +1 -0
  2. package/dist/deepar/LICENSE.txt +1 -0
  3. package/dist/deepar/README.md +329 -0
  4. package/dist/deepar/VERSION.txt +1 -0
  5. package/dist/deepar/default_envmap.webp +0 -0
  6. package/dist/deepar/effects/aviators +0 -0
  7. package/dist/deepar/effects/background_blur.deepar +0 -0
  8. package/dist/deepar/effects/background_replacement.deepar +0 -0
  9. package/dist/deepar/effects/dalmatian +0 -0
  10. package/dist/deepar/effects/galaxy_background +0 -0
  11. package/dist/deepar/effects/koala +0 -0
  12. package/dist/deepar/effects/lion +0 -0
  13. package/dist/deepar/js/deepar.esm.js +2 -0
  14. package/dist/deepar/js/deepar.esm.js.LICENSE.txt +6 -0
  15. package/dist/deepar/js/deepar.js +2 -0
  16. package/dist/deepar/js/deepar.js.LICENSE.txt +6 -0
  17. package/dist/deepar/js/dynamicModules/mediaPipe.js +1 -0
  18. package/dist/deepar/js/dynamicModules/xzimg.js +2 -0
  19. package/dist/deepar/js/dynamicModules/xzimg.js.LICENSE.txt +219 -0
  20. package/dist/deepar/js/types/DeepAR.d.ts +506 -0
  21. package/dist/deepar/js/types/callbacks.d.ts +73 -0
  22. package/dist/deepar/js/types/canvasHelper.d.ts +20 -0
  23. package/dist/deepar/js/types/canvasTouchHelper.d.ts +13 -0
  24. package/dist/deepar/js/types/dynamicModules/mediaPipe/index.d.ts +1 -0
  25. package/dist/deepar/js/types/dynamicModules/xzimg/index.d.ts +1 -0
  26. package/dist/deepar/js/types/errors.d.ts +6 -0
  27. package/dist/deepar/js/types/faceData.d.ts +33 -0
  28. package/dist/deepar/js/types/footData.d.ts +10 -0
  29. package/dist/deepar/js/types/index.d.ts +10 -0
  30. package/dist/deepar/js/types/initParams.d.ts +298 -0
  31. package/dist/deepar/js/types/logType.d.ts +18 -0
  32. package/dist/deepar/js/types/mediaRecorderVideoRecording.d.ts +10 -0
  33. package/dist/deepar/js/types/scriptingApi.d.ts +107 -0
  34. package/dist/deepar/js/types/touchType.d.ts +34 -0
  35. package/dist/deepar/js/types/version.d.ts +5 -0
  36. package/dist/deepar/js/types/webCodecsVideoRecording.d.ts +11 -0
  37. package/dist/deepar/js/types/wristData.d.ts +14 -0
  38. package/dist/deepar/mediaPipe/segmentation/models/selfie_segmenter.tflite +0 -0
  39. package/dist/deepar/mediaPipe/segmentation/models/selfie_segmenter_landscape.tflite +0 -0
  40. package/dist/deepar/mediaPipe/segmentation/wasm/vision_wasm_internal.js +22 -0
  41. package/dist/deepar/mediaPipe/segmentation/wasm/vision_wasm_internal.wasm +0 -0
  42. package/dist/deepar/mediaPipe/segmentation/wasm/vision_wasm_nosimd_internal.js +22 -0
  43. package/dist/deepar/mediaPipe/segmentation/wasm/vision_wasm_nosimd_internal.wasm +0 -0
  44. package/dist/deepar/models/face/models-68-extreme.bin +0 -0
  45. package/dist/deepar/models/face-cnn/face-det.bin +0 -0
  46. package/dist/deepar/models/face-cnn/face-track-19-v2.bin +0 -0
  47. package/dist/deepar/models/foot/foot-detection-96x96x6.bin +0 -0
  48. package/dist/deepar/models/foot/foot-model.obj +3965 -0
  49. package/dist/deepar/models/foot/foot-tracker-96x96x13-test.bin +0 -0
  50. package/dist/deepar/models/foot/foot-tracker-96x96x18-test.bin +0 -0
  51. package/dist/deepar/models/segmentation/segmentation-160x160-opt.bin +0 -0
  52. package/dist/deepar/models/wrist/wrist-det-9.bin +0 -0
  53. package/dist/deepar/models/wrist/wrist-track-181-fast-q.bin +0 -0
  54. package/dist/deepar/models/wrist/wrist-track-181-q.bin +0 -0
  55. package/dist/deepar/models/wrist/wrist-track.obj +3815 -0
  56. package/dist/deepar/package.json +21 -0
  57. package/dist/deepar/wasm/deepar.wasm +0 -0
  58. package/dist/deepar/wasm/dyArcorePhysics.wasm +0 -0
  59. package/dist/deepar/wasm/dyArcoreScripting.wasm +0 -0
  60. package/dist/deepar/wasm/dyXzimgMagicFace.wasm +0 -0
  61. package/dist/deepar/wasm/libxzimgPoseEstimation.wasm +0 -0
  62. package/dist/deepar/wasm/tfjs-backend-wasm-simd.wasm +0 -0
  63. package/dist/deepar/wasm/tfjs-backend-wasm-threaded-simd.wasm +0 -0
  64. package/dist/deepar/wasm/tfjs-backend-wasm.wasm +0 -0
  65. package/dist/shopar-deepar.js +1 -1
  66. package/dist/shopar-plugin.esm.js +1 -1
  67. package/dist/shopar-plugin.js +1 -1
  68. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ Please see: https://developer.deepar.ai/customer-agreement
@@ -0,0 +1 @@
1
+ https://developer.deepar.ai/customer-agreement
@@ -0,0 +1,329 @@
1
+ # deepar
2
+
3
+ DeepAR Web is an augmented reality SDK
4
+ that allows users to integrate advanced, Snapchat-like
5
+ face lenses in the browser environment.
6
+
7
+ DeepAR Web supports:
8
+ - Glasses try-on.
9
+ - Face filters and masks.
10
+ - Background replacement.
11
+ - Background blur.
12
+ - AR mini-games.
13
+
14
+ ## Documentation
15
+
16
+ - Visit official DeepAR docs for Web SDK here https://docs.deepar.ai/deepar-sdk/platforms/web/overview.
17
+ - See the official example here: https://github.com/DeepARSDK/quickstart-web-js-npm
18
+ - Set up and web ad with DeepAR: https://github.com/DeepARSDK/quickstart-web-ad
19
+ - Full API reference [here](https://docs.deepar.ai/deepar-sdk/deep-ar-sdk-for-web/api-reference).
20
+
21
+ ## License key
22
+
23
+ In order to use the DeepAR Web SDK you need to set up a license key for your web app on [developer.deepar.ai](https://developer.deepar.ai).
24
+ 1. Create an account: https://developer.deepar.ai/signup.
25
+ 2. Create a project: https://developer.deepar.ai/projects.
26
+ 3. Add a web app to the project. Note that you need to specify the domain name which you plan to use for hosting the app.
27
+
28
+ > ⚠️ The license key property is required both in a production and development (localhost) environment. Development sessions will not count towards your monthly active usage.
29
+
30
+ ## Installation
31
+
32
+ Using `npm`:
33
+
34
+ ```shell
35
+ $ npm install deepar
36
+ ```
37
+
38
+ Using `yarn`:
39
+
40
+ ```shell
41
+ $ yarn add deepar
42
+ ```
43
+
44
+ ## Getting started
45
+ There are two main ways to get deepar.js in your JavaScript project:
46
+ via [script tags](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_JavaScript_within_a_webpage)
47
+ or by installing it from [NPM](https://www.npmjs.com/package/deepar)
48
+ and using a build tool like
49
+ [Parcel](https://parceljs.org/),
50
+ [WebPack](https://webpack.js.org/),
51
+ or [Rollup](https://rollupjs.org/guide/en).
52
+
53
+ ### via Script tag
54
+ Add the following code to an HTML file:
55
+ ```html
56
+ <html>
57
+ <head>
58
+ <!-- Load deepar.js -->
59
+ <script src='https://cdn.jsdelivr.net/npm/deepar/js/deepar.js'> </script>
60
+ </head>
61
+
62
+ <body>
63
+ <!-- Div element where AR preview will be inserted -->
64
+ <div style='width: 640px; height: 360px' id='deepar-div'></div>
65
+ <!-- Initialize DeepAR and load AR effect/filter -->
66
+ <script>
67
+ (async function() {
68
+ const deepAR = await deepar.initialize({
69
+ licenseKey: 'your_license_key_here',
70
+ previewElement: document.querySelector('#deepar-div'),
71
+ effect: 'https://cdn.jsdelivr.net/npm/deepar/effects/aviators'
72
+ });
73
+ })();
74
+ </script>
75
+ </body>
76
+ </html>
77
+ ```
78
+
79
+ Alternatively, you can import DeepAR as an ES6 module.
80
+
81
+ Via `<script type='module'>`.
82
+ ```html
83
+ <script type='module'>
84
+ import * as deepar from 'https://cdn.jsdelivr.net/npm/deepar/js/deepar.esm.js';
85
+ </script>
86
+ ```
87
+
88
+ Or via dynamic [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
89
+ ```javascript
90
+ const deepar = await import('https://cdn.jsdelivr.net/npm/deepar/js/deepar.esm.js');
91
+ ```
92
+
93
+ ### via NPM
94
+ Add deepar.js to your project using [yarn](https://yarnpkg.com/en/) or
95
+ [npm](https://docs.npmjs.com/cli/npm).
96
+
97
+ **Note**: Because we use ES2017 syntax (such as import),
98
+ this workflow assumes you are using a modern browser or a
99
+ bundler/transpiler to convert your code to something older browsers
100
+ understand. However, you are free to use any build tool that you prefer.
101
+
102
+ ```javascript
103
+ import * as deepar from 'deepar';
104
+
105
+ const deepAR = await deepar.initialize({
106
+ licenseKey: 'your_license_key_here',
107
+ previewElement: document.querySelector('#deepar-canvas'),
108
+ effect: 'https://cdn.jsdelivr.net/npm/deepar/effects/aviators'
109
+ });
110
+ ```
111
+
112
+ ## Switch effects
113
+
114
+ AR filters are represented by effect files in DeepAR. You can load them to preview the effect.
115
+
116
+ Places you can get DeepAR effects:
117
+ - Download a free filter pack: https://docs.deepar.ai/deepar-sdk/filters#free-effects-pack-content.
118
+ - Visit DeepAR asset store: https://www.store.deepar.ai/
119
+ - Create your own filters with [DeepAR Studio](https://www.deepar.ai/creator-studio).
120
+
121
+ Load an effect using the `switchEffect` method:
122
+ ```javascript
123
+ await deepAR.switchEffect('path/to/effect/alien');
124
+ ```
125
+
126
+ ## Take screenshot or video
127
+
128
+ Take a screenshot.
129
+ ```javascript
130
+ // The image is a data url.
131
+ const image = await deepAR.takeScreenshot();
132
+ ```
133
+
134
+ Record a video.
135
+ ```javascript
136
+ await deepAR.startVideoRecording();
137
+ // Video is now recording...
138
+ // When user is ready to stop recording.
139
+ const video = await deepAR.finishVideoRecording();
140
+ ```
141
+
142
+ ## Background blur
143
+
144
+ Enable background blur with strength 5.
145
+ ```javascript
146
+ await deepAR.backgroundBlur(true, 5)
147
+ ```
148
+
149
+ ## Background replacement
150
+
151
+ This is also known as background removal or green screen effect.
152
+
153
+ Enable background replacement with an image of a sunny beach.
154
+ ```javascript
155
+ await deepAR.backgroundReplacement(true, 'images/sunny_beach.png')
156
+ ```
157
+
158
+ ## Callbacks
159
+
160
+ DeepAR has some callbacks you can implement for additional informations. For example,
161
+ to check if face is detected in the scene.
162
+ ```javascript
163
+ await deepAR.switchEffect('https://cdn.jsdelivr.net/npm/deepar/effects/aviators');
164
+ deepAR.callbacks.onFaceTracked = function(faceDataArr) {
165
+ if (faceDataArr[0].detected) {
166
+ console.log("Face is detected!");
167
+ }
168
+ };
169
+ ```
170
+
171
+ To remove callback if you don't need it anymore.
172
+ ```javascript
173
+ deepAR.callbacks.onFaceTracked = undefined;
174
+ ```
175
+
176
+ ## Different video sources
177
+
178
+ DeepAR will by default use the user facing camera. It will also ask the
179
+ camera permission from the user.
180
+
181
+ Use the back camera on the phones:
182
+ ```javascript
183
+ const deepAR = await deepar.initialize({
184
+ // ...
185
+ additionalOptions: {
186
+ cameraConfig: {
187
+ facingMode: 'environment'
188
+ }
189
+ }
190
+ });
191
+ ```
192
+
193
+ Set up your own camera or custom video source:
194
+ ```javascript
195
+ const deepAR = await deepar.initialize({
196
+ // ...
197
+ additionalOptions: {
198
+ cameraConfig: {
199
+ disableDefaultCamera: true
200
+ }
201
+ }
202
+ });
203
+
204
+ // HTMLVideoElement that can contain camera or any video.
205
+ const video = ...;
206
+
207
+ deepAR.setVideoElement(video, true);
208
+ ```
209
+
210
+ Initialize DeepAR but start the camera later.
211
+ This is used when you do not want to ask the camera permission right away.
212
+ ```javascript
213
+ const deepAR = await deepar.initialize({
214
+ // ...
215
+ additionalOptions: {
216
+ cameraConfig: {
217
+ disableDefaultCamera: true
218
+ }
219
+ }
220
+ });
221
+
222
+ // When you want to ask the camera permission and start the camera.
223
+ await deepAR.startCamera();
224
+ ```
225
+
226
+ ## Providing your own canvas for rendering
227
+
228
+ Create canvas directly in the HTML:
229
+ ```html
230
+ <canvas width='1280' height='720'></canvas>
231
+ ```
232
+
233
+ Or you can create it in Javascript.
234
+ ```javascript
235
+ const canvas = document.createElement('canvas');
236
+ // Set canvas size, accounting screen resolution (to make it look 🤌 even on high definition displays)
237
+ const canvasSize = { width: 640, height: 360 };
238
+ const dpr = window.devicePixelRatio || 1;
239
+ canvas.style.maxWidth = `${canvasSize.width}px`;
240
+ canvas.style.maxHeight = `${canvasSize.height}px`;
241
+ canvas.width = Math.floor(canvasSize.width * dpr);
242
+ canvas.height = Math.floor(canvasSize.height * dpr);
243
+ ```
244
+
245
+ > ⚠️ **Note:** Be sure to set `width` and `height` properties of the `canvas`!
246
+
247
+ You can always change the canvas dimensions and they don't have to match the
248
+ input video resolution. DeepAR will fit the input camera/video stream correctly
249
+ to any canvas size.
250
+
251
+ You pass the canvas when initializing DeepAR.
252
+ ```javascript
253
+ await deepar.initialize({
254
+ canvas: canvas,
255
+ // ...
256
+ });
257
+ ```
258
+
259
+ ## Download speed optimizations for DeepAR Web
260
+
261
+ Apart from the main *deepar.js* file and AR effect files, DeepAR uses additional files like:
262
+ - WebAssembly (WASM) files.
263
+ - ML model files.
264
+
265
+ Some of them are required and will be downloaded every time. The others will be lazy
266
+ downloaded when/if needed.
267
+
268
+ > ⚠️ DeepAR will by default automatically fetch all additional resources from the [JsDelivr](https://www.jsdelivr.com/) CDN.
269
+
270
+ Fetching files from JsDelivr is not recommended if you care about download
271
+ speeds of DeepAR Web resources. This is because the files on JsDelivr are not compressed.
272
+
273
+ ### Compression
274
+
275
+ To optimize download speeds, all the DeepAR files should be compressed.
276
+ It is recommended to serve DeepAR files from your own server or some CDN which supports file compression.
277
+
278
+ > If it is supported, you should use [GZip](https://developer.mozilla.org/en-US/docs/Glossary/GZip_compression) or
279
+ > [Brotli](https://developer.mozilla.org/en-US/docs/Glossary/Brotli_compression) compression on all DeepAR files which will significantly reduce the
280
+ > SDK size. Check out your server/CDN options for compressing files.
281
+
282
+ ### Custom deployment of DeepAR Web
283
+
284
+ DeepAR Web can be downloaded from [DeepAR Developer Portal](https://developer.deepar.ai/downloads).
285
+ But since most users will install DeepAR through NPM, follow the next instructions.
286
+
287
+ It is recommended to copy `./node_modules/deepar` directory which contains all the DeepAR
288
+ files into your distribution (dist) folder.
289
+ You can use `rootPath` to set a path to the custom root of the DeepAR SDK. All additional files
290
+ that need to be fetched by DeepAR will be resolved against the given `rootPath`.
291
+
292
+ ```javascript
293
+ const deepAR = await deepar.initialize({
294
+ // ...
295
+ rootPath: 'path/to/root/deepar/directory'
296
+ });
297
+ ```
298
+
299
+ > It is recommended to setup the copying of the DeepAR directory as part of you bundler build scripts,
300
+ > in case you ever need to updated to a newer version of DeepAR.
301
+
302
+ #### Specifying paths for each file
303
+
304
+ Another option, instead of using the DeepAR directory and copying it as-is, is to specify
305
+ a path to each file. The advantage of this is that you can use the bundler to keep track of your files.
306
+
307
+ For example, if using [Webpack](https://webpack.js.org/), you can use it's
308
+ [asset modules](https://webpack.js.org/guides/asset-modules/) to import all the files needed.
309
+
310
+ Pass the file paths in `additionalOptions`.
311
+
312
+ ```javascript
313
+ const deepAR = await deepar.initialize({
314
+ // ...
315
+ additinalOptions: {
316
+ faceTrackingConfig: {
317
+ modelPath: 'path/to/deepar/models/face/models-68-extreme.bin'
318
+ },
319
+ segmentationConfig: {
320
+ modelPath: 'path/to/deepar/models/segmentation/segmentation-160x160-opt.bin'
321
+ },
322
+ deeparWasmPath: 'path/to/deepar/wasm/deepar.wasm'
323
+ }
324
+ });
325
+ ```
326
+
327
+ ## License
328
+
329
+ Please see: https://developer.deepar.ai/customer-agreement
@@ -0,0 +1 @@
1
+ DeepAR SDK version: v5.6.6-test-alpha-210
Binary file
Binary file
Binary file
Binary file
Binary file