release rebuild

pull/280/head
Vladimir Mandic 2022-01-20 08:17:06 -05:00
parent 9a94631146
commit 455c7f519d
4 changed files with 18 additions and 18 deletions

View File

@ -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

21
TODO.md
View File

@ -29,19 +29,22 @@ Feature is automatically disabled in NodeJS without user impact
<br><hr><br>
## 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`

View File

@ -12,10 +12,6 @@ const options = {
async function httpHandler(url, init?): Promise<Response | null> {
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<GraphMod
const cachedModelName = 'indexeddb://' + modelPathSegments[modelPathSegments.length - 1].replace('.json', ''); // generate short model name for cache
const cachedModels = await tf.io.listModels(); // list all models already in cache
const modelCached = options.cacheModels && Object.keys(cachedModels).includes(cachedModelName); // is model found in cache
// create model prototype and decide if load from cache or from original modelurl
const model: GraphModel = new tf.GraphModel(modelCached ? cachedModelName : modelUrl, { fetchFunc: (url, init?) => 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

2
wiki

@ -1 +1 @@
Subproject commit 811b06ec406bfea770d2a548e7c69575d9cb9232
Subproject commit af424150fe3dd66dae9d952989f60eb9ad87e5e4