@tradalab/mediakit 2.0.0 → 2.1.1
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 +9 -1
- package/dist/detect-worker.js +4825 -0
- package/dist/detect-worker.js.map +1 -0
- package/dist/index.d.ts +30 -3
- package/dist/index.js +256 -26
- package/dist/index.js.map +1 -1
- package/dist/mediakit.wasm +0 -0
- package/dist/worker.js +252 -24
- package/dist/worker.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,12 @@ face retouching.
|
|
|
6
6
|
|
|
7
7
|
The examples named below live in the repository under `web/example/`; `make example` serves them.
|
|
8
8
|
|
|
9
|
+
### Upgrading to 2.1
|
|
10
|
+
|
|
11
|
+
Serve `dist/detect-worker.js` as `/mediakit/detect-worker.js` next to `worker.js`. Face landmarks
|
|
12
|
+
and the multiclass segmenter run there, off the frame path. Without it they run in-thread as in
|
|
13
|
+
2.0, and the studio recipes can stall frames.
|
|
14
|
+
|
|
9
15
|
### Upgrading to 2.0
|
|
10
16
|
|
|
11
17
|
2.0 moves to `@mediapipe/tasks-vision` 1.1.1. Install `@mediapipe/tasks-vision@~1.1.1` and serve
|
|
@@ -33,6 +39,7 @@ ever fetched from a third party while a frame is being processed.
|
|
|
33
39
|
| `/mediakit/mediakit.wasm` | this package's `dist/` | always |
|
|
34
40
|
| `/mediakit/wasm_exec.js` | this package's `dist/` | always, and it must stay with that `.wasm` |
|
|
35
41
|
| `/mediakit/worker.js` | this package's `dist/` | to get the worker transport |
|
|
42
|
+
| `/mediakit/detect-worker.js` | this package's `dist/` | face landmarks and the multiclass segmenter off the frame path; without it they run in-thread and can stall frames |
|
|
36
43
|
| `/mediakit/mp/` | the files inside `@mediapipe/tasks-vision/wasm/`, flat, from the same 1.1.x release | any recipe where `needsMask()` or `needsFace()` is true |
|
|
37
44
|
| `/mediakit/selfie_segmenter.tflite` | MediaPipe model | `needsMask()` is true |
|
|
38
45
|
| `/mediakit/face_landmarker.task` | MediaPipe model | `needsFace()` is true |
|
|
@@ -234,7 +241,7 @@ few times a second; reading it per frame costs more than it tells you.
|
|
|
234
241
|
|
|
235
242
|
```ts
|
|
236
243
|
const s = pipeline.stats
|
|
237
|
-
// s.totalMs, s.segMs, s.glCalls, s.segmented, s.maskScale, s.workScale,
|
|
244
|
+
// s.totalMs, s.segMs, s.faceMs, s.glCalls, s.segmented, s.maskScale, s.workScale,
|
|
238
245
|
// s.cropCX, s.cropCY, s.cropZoom, s.needsMask, s.faceFound, s.faceSize, s.needsFace
|
|
239
246
|
```
|
|
240
247
|
|
|
@@ -247,6 +254,7 @@ not a setting.
|
|
|
247
254
|
```ts
|
|
248
255
|
const pipeline = new VideoPipeline(filter, effects, {
|
|
249
256
|
alpha: true, // keep alpha for subscribeFrames + cutout
|
|
257
|
+
maxFaces: 1, // one person per camera: ~a third less landmark cost
|
|
250
258
|
onStall: ({ transport, sinceMs }) => report(transport, sinceMs),
|
|
251
259
|
onTrackReplaced: (track) => sender.replaceTrack(track),
|
|
252
260
|
})
|