From f4bc35c3b3e6cb48129e31959051058f1c48f875 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 8 Mar 2021 10:06:34 -0500 Subject: [PATCH] fix performance issue when running with low confidence --- config.js | 7 +++---- demo/browser.js | 7 ++++--- package.json | 1 - wiki | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config.js b/config.js index 7541b96d..07e51e3e 100644 --- a/config.js +++ b/config.js @@ -75,7 +75,7 @@ export default { // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees maxFaces: 10, // maximum number of faces detected in the input // should be set to the minimum number for performance - skipFrames: 11, // how many frames to go without re-running the face bounding box detector + skipFrames: 21, // how many frames to go without re-running the face bounding box detector // only used for video inputs // e.g., if model is running st 25 FPS, we can re-use existing bounding // box for updated face analysis as the head probably hasn't moved much @@ -94,7 +94,6 @@ export default { enabled: true, modelPath: '../models/facemesh.json', inputSize: 192, // fixed value - returnRawData: false, // in addition to standard mesh and box values, return raw normalized values as well }, iris: { @@ -116,7 +115,7 @@ export default { minConfidence: 0.1, // threshold for discarding a prediction modelPath: '../models/gender.json', // can be 'gender' or 'gender-ssrnet-imdb' inputSize: 64, // fixed value - skipFrames: 41, // how many frames to go without re-running the detector + skipFrames: 32, // how many frames to go without re-running the detector // only used for video inputs }, @@ -124,7 +123,7 @@ export default { enabled: true, inputSize: 64, // fixed value minConfidence: 0.1, // threshold for discarding a prediction - skipFrames: 21, // how many frames to go without re-running the detector + skipFrames: 33, // how many frames to go without re-running the detector modelPath: '../models/emotion.json', }, diff --git a/demo/browser.js b/demo/browser.js index c7a158b3..716c3263 100644 --- a/demo/browser.js +++ b/demo/browser.js @@ -6,13 +6,13 @@ const userConfig = { backend: 'webgl' }; // add any user configuration overrides /* const userConfig = { - backend: 'wasm', + backend: 'webgl', async: false, warmup: 'face', - videoOptimized: false, + videoOptimized: true, face: { enabled: true, iris: { enabled: false }, mesh: { enabled: true }, age: { enabled: false }, gender: { enabled: false }, emotion: { enabled: false }, embedding: { enabled: false } }, hand: { enabled: false }, - gestures: { enabled: true }, + gesture: { enabled: false }, body: { enabled: false, modelType: 'blazepose', modelPath: '../models/blazepose.json' }, }; */ @@ -424,6 +424,7 @@ function setupMenu() { }); menu.display.addHTML('
'); menu.display.addBool('use 3D depth', human.draw.options, 'useDepth'); + menu.display.addBool('draw with curves', human.draw.options, 'useCurves'); menu.display.addBool('print labels', human.draw.options, 'drawLabels'); menu.display.addBool('draw points', human.draw.options, 'drawPoints'); menu.display.addBool('draw boxes', human.draw.options, 'drawBoxes'); diff --git a/package.json b/package.json index 6866c9d4..74ad7106 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "type": "git", "url": "git+https://github.com/vladmandic/human.git" }, - "dependencies": {}, "peerDependencies": {}, "devDependencies": { "@tensorflow/tfjs": "^3.2.0", diff --git a/wiki b/wiki index 0b8afcd5..f981107e 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 0b8afcd5149686d64d6f00bebe33937cd175d949 +Subproject commit f981107e84085bb5ac93441162e900a0d73d0503