fix performance issue when running with low confidence

pull/280/head
Vladimir Mandic 2021-03-08 10:06:34 -05:00
parent b02a2962f3
commit f4bc35c3b3
4 changed files with 8 additions and 9 deletions

View File

@ -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',
},

View File

@ -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('<hr style="border-style: inset; border-color: dimgray">');
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');

View File

@ -20,7 +20,6 @@
"type": "git",
"url": "git+https://github.com/vladmandic/human.git"
},
"dependencies": {},
"peerDependencies": {},
"devDependencies": {
"@tensorflow/tfjs": "^3.2.0",

2
wiki

@ -1 +1 @@
Subproject commit 0b8afcd5149686d64d6f00bebe33937cd175d949
Subproject commit f981107e84085bb5ac93441162e900a0d73d0503