@tradalab/mediakit 2.9.1 → 2.10.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/README.md CHANGED
@@ -6,6 +6,35 @@ 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.10.0
10
+
11
+ No change to the API an app calls; serve the new `worker.js`, `detect-worker.js` and
12
+ `mediakit.wasm`, and install `@tradalab/tskit`, now a dependency (a bundler picks it up; a page
13
+ that loads `dist/index.js` through an import map maps `@tradalab/tskit/assets` and
14
+ `@tradalab/tskit/progress` too, as the examples do).
15
+
16
+ **New: every file mediakit fetches is downloaded once per origin and kept.** The MediaPipe runtime,
17
+ the models, the face cover and its onnxruntime wasm, `mediakit.wasm` and `wasm_exec.js` now go
18
+ through one manager on the page (`@tradalab/tskit/assets`): workers ask the page for them instead of
19
+ fetching on their own, and the bytes are kept in Cache Storage under `mediakit-v<version>`, which
20
+ does not depend on HTTP caching. Measured on Edge with three pipelines started at once on a server
21
+ sending no cache headers (the case of a self-signed certificate): 15 requests before, 6 of them for
22
+ the 13.5 MB MediaPipe wasm; 4 now, one per file; 0 on the next page load, where the first pipeline
23
+ was ready in 1.7 s instead of 2.6 s. Output pixels unchanged. Where Cache Storage is missing (not a
24
+ secure context) the files are kept in memory for the page. The files of older mediakit versions
25
+ are deleted from Cache Storage the first time a page of this version uses mediakit.
26
+
27
+ The MediaPipe runtime, `wasm_exec.js` and onnxruntime's glue now load from `blob:` URLs made from
28
+ those bytes. A page with a Content-Security-Policy has to allow `blob:` in `script-src` (and in
29
+ `worker-src` where it is set); without it the detectors fail to load and `health.parts` says so.
30
+
31
+ **New: `clearCachedAssets()`** deletes what this version keeps on disk, for a "free up space"
32
+ setting. Pipelines already running keep working; the next one downloads what it needs again.
33
+
34
+ `preloadDetectors` keeps its signature and its progress rules; it now fills Cache Storage rather
35
+ than the HTTP cache, so it helps on hosts that do not send cache headers too. Images the app gives
36
+ (backgrounds, LUTs, makeup textures) are still fetched as before.
37
+
9
38
  ### Upgrading to 2.9.0
10
39
 
11
40
  No change for an app that does not read the new fields; serve the new `worker.js`,