From a3bf652abc823bd4f98a1cfa563b3ca386d1a5e9 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 29 May 2021 18:29:57 -0400 Subject: [PATCH] quantize handdetect model --- CHANGELOG.md | 3 ++- TODO.md | 7 +++---- demo/index.js | 4 ++-- src/config.ts | 4 ++-- src/human.ts | 8 ++++++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 059bc9f7..504ef673 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ Repository: **** ## Changelog -### **HEAD -> main** 2021/05/28 mandic00@live.com +### **HEAD -> main** 2021/05/29 mandic00@live.com +- added experimental movenet-lightning and removed blazepose from default dist - added experimental face.rotation.gaze - fix and optimize for mobile platform - lock typescript to 4.2 due to typedoc incompatibility with 4.3 diff --git a/TODO.md b/TODO.md index dfdadf35..3b8f4761 100644 --- a/TODO.md +++ b/TODO.md @@ -7,13 +7,12 @@ N/A ## Exploring Features - Switch from PoseNet to MoveNet -- Optimize HandPose +- Implement demo as installable PWA with model caching +- Implement results interpolation on library level ## Explore Models -- InsightFace - RetinaFace detector and ArcFace recognition - +- InsightFace: RetinaFace detector and ArcFace recognition: ## In Progress diff --git a/demo/index.js b/demo/index.js index dde4ff69..23ede44b 100644 --- a/demo/index.js +++ b/demo/index.js @@ -15,7 +15,7 @@ import webRTC from './helpers/webrtc.js'; let human; const userConfig = { - warmup: 'none', + warmup: 'full', /* backend: 'webgl', async: false, @@ -33,8 +33,8 @@ const userConfig = { }, hand: { enabled: false }, // body: { enabled: true, modelPath: 'posenet.json' }, - body: { enabled: true, modelPath: 'movenet-lightning.json' }, // body: { enabled: true, modelPath: 'blazepose.json' }, + body: { enabled: true, modelPath: 'movenet-lightning.json' }, object: { enabled: false }, gesture: { enabled: true }, */ diff --git a/src/config.ts b/src/config.ts index 08210d76..ec6ec91e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -287,8 +287,8 @@ const config: Config = { body: { enabled: true, - modelPath: 'posenet.json', // body model, can be absolute path or relative to modelBasePath - // can be 'posenet', 'blazepose', 'efficientpose', 'movenet' + modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath + // can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder' maxDetected: 1, // maximum number of people detected in the input // should be set to the minimum number for performance // only valid for posenet as other models detects single pose diff --git a/src/human.ts b/src/human.ts index 6e9b7e24..ae1ead72 100644 --- a/src/human.ts +++ b/src/human.ts @@ -60,6 +60,10 @@ export class Human { * - Details: {@link Config} */ config: Config; + /** Last known result of detect run + * - Can be accessed anytime after initial detection + */ + result: Result; /** Current state of Human library * - Can be polled to determine operations that are currently executed */ @@ -548,7 +552,7 @@ export class Human { this.perf.total = Math.trunc(now() - timeStart); this.state = 'idle'; - const res = { + this.result = { face: faceRes, body: bodyRes, hand: handRes, @@ -564,7 +568,7 @@ export class Human { tf.dispose(process.tensor); // log('Result:', result); - resolve(res); + resolve(this.result); }); }