diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ffe3250..95ee1991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,12 @@ ## Changelog -### **HEAD -> main** 2021/10/21 mandic00@live.com +### **2.3.6** 2021/10/21 mandic00@live.com + +### **origin/main** 2021/10/21 mandic00@live.com + +- refactor human.env to a class type - add human.custom.esm using custom tfjs build ### **2.3.5** 2021/10/19 mandic00@live.com diff --git a/demo/index.js b/demo/index.js index 49b684c7..f90a2667 100644 --- a/demo/index.js +++ b/demo/index.js @@ -90,7 +90,7 @@ const ui = { autoPlay: false, // start webcam & detection on load // internal variables - exceptionHandler: false, // should capture all unhandled exceptions + exceptionHandler: true, // should capture all unhandled exceptions busy: false, // internal camera busy flag menuWidth: 0, // internal menuHeight: 0, // internal diff --git a/src/hand/fingerpose.ts b/src/hand/fingerpose.ts index 5aadc35c..e7513234 100644 --- a/src/hand/fingerpose.ts +++ b/src/hand/fingerpose.ts @@ -226,7 +226,6 @@ export function analyze(keypoints) { // get estimations of curl / direction for direction: FingerDirection.getName(estimatorRes.directions[fingerIdx]), }; } - // console.log('finger landmarks', landmarks); return landmarks; } @@ -238,6 +237,5 @@ export function match(keypoints) { // compare gesture description to each known const confidence = gesture.matchAgainst(estimatorRes.curls, estimatorRes.directions); if (confidence >= minConfidence) poses.push({ name: gesture.name, confidence }); } - // console.log('finger poses', poses); return poses; } diff --git a/src/hand/handposedetector.ts b/src/hand/handposedetector.ts index 656cbd68..26c35a28 100644 --- a/src/hand/handposedetector.ts +++ b/src/hand/handposedetector.ts @@ -60,7 +60,6 @@ export class HandDetector { const palmBox = tf.slice(t.norm, [index, 0], [1, -1]); const palmLandmarks = tf.tidy(() => tf.reshape(this.normalizeLandmarks(tf.slice(t.predictions, [index, 5], [1, 14]), index), [-1, 2])); hands.push({ box: palmBox, palmLandmarks, confidence: scores[index] }); - // console.log('handdetector:getBoxes', nms.length, index, scores[index], config.hand.maxDetected, config.hand.iouThreshold, config.hand.minConfidence, palmBox.dataSync()); } for (const tensor of Object.keys(t)) tf.dispose(t[tensor]); // dispose all return hands; diff --git a/src/hand/handposepipeline.ts b/src/hand/handposepipeline.ts index fdb69d82..be9af789 100644 --- a/src/hand/handposepipeline.ts +++ b/src/hand/handposepipeline.ts @@ -141,7 +141,6 @@ export class HandPipeline { }; hands.push(result); } else { - // console.log('handpipeline:estimateHands low', confidence); this.storedBoxes[i] = null; } tf.dispose(keypoints); diff --git a/src/human.ts b/src/human.ts index 4854d47b..d281aabe 100644 --- a/src/human.ts +++ b/src/human.ts @@ -175,7 +175,9 @@ export class Human { */ constructor(userConfig?: Partial) { this.env = env; - defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`; + defaults.wasmPath = tf.version_core.includes('-') // custom build or official build + ? 'https://vladmandic.github.io/tfjs/dist/' + : `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`; defaults.modelBasePath = env.browser ? '../models/' : 'file://models/'; defaults.backend = env.browser ? 'humangl' : 'tensorflow'; this.version = app.version; // expose version property on instance of class diff --git a/test/browser.html b/test/browser.html index ee44ddd0..6cf73861 100644 --- a/test/browser.html +++ b/test/browser.html @@ -26,7 +26,7 @@