From b586c0d998095a2a7a6bceb13f92a15a99e661ee Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 20 Jan 2022 08:17:06 -0500 Subject: [PATCH] release rebuild --- CHANGELOG.md | 5 +++-- TODO.md | 21 ++++++++++++--------- src/tfjs/load.ts | 8 ++------ wiki | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ed833c..85a5229d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,12 @@ ## Changelog -### **HEAD -> main** 2022/01/16 mandic00@live.com +### **2.6.1** 2022/01/20 mandic00@live.com -### **origin/main** 2022/01/15 mandic00@live.com +### **origin/main** 2022/01/17 mandic00@live.com +- prototype global fetch handler - fix face box and hand tracking when in front of face ### **2.5.8** 2022/01/14 mandic00@live.com diff --git a/TODO.md b/TODO.md index 822ca080..4d946379 100644 --- a/TODO.md +++ b/TODO.md @@ -29,19 +29,22 @@ Feature is automatically disabled in NodeJS without user impact


-## Pending Release Notes +## Human 2.6 Release Notes -- Add global model cache hander using indexdb in browser environments +- Add model cache hander using **IndexDB** in *browser* environments see `config.cacheModels` setting for details - Add additional demos `human-motion` and `human-avatar` - Updated samples image gallery -- Fix face box detections when face is partially occluded -- Fix face box scaling -- Fix hand tracking when hand is in front of face -- Fix compatibility with `ElectronJS` -- Fix interpolation for some body keypoints -- Updated blazepose calculations -- Changes to blazepose and handlandmarks annotations +- Allow monkey-patching `fetch` in NodeJS + If `fetch` function is defined, it can be used to load models + from HTTP/HTTPS URLs regardless of `tfjs` platform support +- Fix `BlazeFace` detections when face is partially occluded +- Fix `BlazeFace` box scaling +- Fix `HandTrack` tracking when hand is in front of face +- Fix `ElectronJS` compatibility issues +- Fix body keypoints interpolation algorithm +- Updated `BlazePose` calculations +- Changes to `BlazePose` and `HandLandmark` annotations - Strong typing for string enums - Updated `TFJS` diff --git a/src/tfjs/load.ts b/src/tfjs/load.ts index 956ade02..c905bee9 100644 --- a/src/tfjs/load.ts +++ b/src/tfjs/load.ts @@ -12,10 +12,6 @@ const options = { async function httpHandler(url, init?): Promise { if (options.debug) log('load model fetch:', url, init); - if (typeof fetch === 'undefined') { - log('error loading model: fetch function is not defined:'); - return null; - } return fetch(url, init); } @@ -31,8 +27,8 @@ export async function loadModel(modelPath: string | undefined): Promise httpHandler(url, init) }) as unknown as GraphModel; + const tfLoadOptions = typeof fetch === 'undefined' ? {} : { fetchFunc: (url, init?) => httpHandler(url, init) }; + const model: GraphModel = new tf.GraphModel(modelCached ? cachedModelName : modelUrl, tfLoadOptions) as unknown as GraphModel; // create model prototype and decide if load from cache or from original modelurl try { // @ts-ignore private function model.findIOHandler(); // decide how to actually load a model diff --git a/wiki b/wiki index 811b06ec..af424150 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 811b06ec406bfea770d2a548e7c69575d9cb9232 +Subproject commit af424150fe3dd66dae9d952989f60eb9ad87e5e4