diff --git a/config.js b/config.js index 6434eb03..181e9d74 100644 --- a/config.js +++ b/config.js @@ -76,6 +76,8 @@ export default { // 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 // in short time (10 * 1/25 = 0.25 sec) + skipInitial: false, // if previous detection resulted in no faces detected, + // should skipFrames be reset immediately minConfidence: 0.2, // threshold for discarding a prediction iouThreshold: 0.2, // threshold for deciding whether boxes overlap too much in // non-maximum suppression (0.1 means drop if overlap 10%) @@ -154,6 +156,8 @@ export default { // e.g., if model is running st 25 FPS, we can re-use existing bounding // box for updated hand skeleton analysis as the hand probably // hasn't moved much in short time (10 * 1/25 = 0.25 sec) + skipInitial: false, // if previous detection resulted in no faces detected, + // should skipFrames be reset immediately minConfidence: 0.1, // threshold for discarding a prediction iouThreshold: 0.1, // threshold for deciding whether boxes overlap too much // in non-maximum suppression diff --git a/demo/browser.js b/demo/browser.js index cc84a9f3..98519a54 100644 --- a/demo/browser.js +++ b/demo/browser.js @@ -8,8 +8,9 @@ import draw from './draw.js'; import Menu from './menu.js'; import GLBench from './gl-bench.js'; -// const userConfig = {}; // add any user configuration overrides +const userConfig = {}; // add any user configuration overrides +/* const userConfig = { backend: 'wasm', async: false, @@ -18,6 +19,7 @@ const userConfig = { body: { enabled: false }, hand: { enabled: false }, }; +*/ const human = new Human(userConfig); diff --git a/src/handpose/handpipeline.ts b/src/handpose/handpipeline.ts index 3d8ea872..d6ba37e4 100644 --- a/src/handpose/handpipeline.ts +++ b/src/handpose/handpipeline.ts @@ -90,7 +90,8 @@ export class HandPipeline { if (this.storedBoxes.length > 0) useFreshBox = true; } const hands: Array<{}> = []; - // log('hand', `skipped: ${this.skipped} max: ${config.hand.maxHands} detected: ${this.detectedHands} stored: ${this.storedBoxes.length} new: ${boxes?.length}`); + + if (config.hand.skipInitial && this.detectedHands === 0) this.skipped = 0; // go through working set of boxes for (let i = 0; i < this.storedBoxes.length; i++) { diff --git a/wiki b/wiki index 35cb9ec1..c283c4a2 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 35cb9ec10d7036a8a2ec425c00798050dd9eafea +Subproject commit c283c4a21d26dc0ba03e576dae8e6fbd3af12ac8