updated docs

master
Vladimir Mandic 2021-03-11 13:31:28 -05:00
parent 8d403c2d9d
commit 69294f7a0a
3 changed files with 20 additions and 32 deletions

@ -41,7 +41,7 @@ config = {
// when backend is set outside of Human library // when backend is set outside of Human library
wasmPath: '../assets/', // path for wasm binaries wasmPath: '../assets/', // path for wasm binaries
// only used for backend: wasm // only used for backend: wasm
debug: false, // print additional status messages to console debug: true, // print additional status messages to console
async: true, // execute enabled models in parallel async: true, // execute enabled models in parallel
// this disables per-model performance data but // this disables per-model performance data but
// slightly increases performance // slightly increases performance
@ -97,28 +97,25 @@ config = {
enabled: true, // controls if specified modul is enabled enabled: true, // controls if specified modul is enabled
// face.enabled is required for all face models: // face.enabled is required for all face models:
// detector, mesh, iris, age, gender, emotion // detector, mesh, iris, age, gender, emotion
// running detector only with mesh disabled is not recommended as detector prepares list of candidates
// which are then validated and stabilized by mesh
// running detetor-only produces fast but unreliable results with false positives
// (note: module is not loaded until it is required) // (note: module is not loaded until it is required)
detector: { detector: {
modelPath: '../models/blazeface-back.json', modelPath: '../models/blazeface-back.json',
inputSize: 256, // fixed value rotation: true, // use best-guess rotated face image or just box with rotation as-is
rotation: false, // use best-guess rotated face image or just box with rotation as-is
// false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees // false means higher performance, but incorrect mesh mapping if face angle is above 20 degrees
// this parameter is not valid in nodejs
maxFaces: 10, // maximum number of faces detected in the input maxFaces: 10, // maximum number of faces detected in the input
// should be set to the minimum number for performance // 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 // only used for video inputs
// e.g., if model is running st 25 FPS, we can re-use existing bounding // 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 // box for updated face analysis as the head probably hasn't moved much
// in short time (10 * 1/25 = 0.25 sec) // in short time (10 * 1/25 = 0.25 sec)
skipInitial: false, // if previous detection resulted in no faces detected, skipInitial: false, // if previous detection resulted in no faces detected,
// should skipFrames be reset immediately // should skipFrames be reset immediately
minConfidence: 0.5, // threshold for discarding a prediction minConfidence: 0.2, // threshold for discarding a prediction
iouThreshold: 0.2, // threshold for deciding whether boxes overlap too much in iouThreshold: 0.1, // threshold for deciding whether boxes overlap too much in
// non-maximum suppression (0.1 means drop if overlap 10%) // non-maximum suppression (0.1 means drop if overlap 10%)
scoreThreshold: 0.5, // threshold for deciding when to remove boxes based on score scoreThreshold: 0.2, // threshold for deciding when to remove boxes based on score
// in non-maximum suppression, // in non-maximum suppression,
// this is applied on detection objects only and before minConfidence // this is applied on detection objects only and before minConfidence
}, },
@ -126,19 +123,16 @@ config = {
mesh: { mesh: {
enabled: true, enabled: true,
modelPath: '../models/facemesh.json', modelPath: '../models/facemesh.json',
inputSize: 192, // fixed value
}, },
iris: { iris: {
enabled: true, enabled: true,
modelPath: '../models/iris.json', modelPath: '../models/iris.json',
inputSize: 64, // fixed value
}, },
age: { age: {
enabled: true, enabled: true,
modelPath: '../models/age-ssrnet-imdb.json', modelPath: '../models/age.json',
inputSize: 64, // fixed value
skipFrames: 31, // how many frames to go without re-running the detector skipFrames: 31, // how many frames to go without re-running the detector
// only used for video inputs // only used for video inputs
}, },
@ -146,23 +140,20 @@ config = {
gender: { gender: {
enabled: true, enabled: true,
minConfidence: 0.1, // threshold for discarding a prediction minConfidence: 0.1, // threshold for discarding a prediction
modelPath: '../models/gender.json', // can be 'gender' or 'gender-ssrnet-imdb' modelPath: '../models/gender.json',
inputSize: 64, // fixed value skipFrames: 32, // how many frames to go without re-running the detector
skipFrames: 41, // how many frames to go without re-running the detector
// only used for video inputs // only used for video inputs
}, },
emotion: { emotion: {
enabled: true, enabled: true,
inputSize: 64, // fixed value minConfidence: 0.1, // threshold for discarding a prediction
minConfidence: 0.2, // threshold for discarding a prediction skipFrames: 33, // how many frames to go without re-running the detector
skipFrames: 21, // how many frames to go without re-running the detector
modelPath: '../models/emotion.json', modelPath: '../models/emotion.json',
}, },
embedding: { embedding: {
enabled: false, enabled: false,
inputSize: 112, // fixed value
modelPath: '../models/mobilefacenet.json', modelPath: '../models/mobilefacenet.json',
}, },
}, },
@ -170,23 +161,20 @@ config = {
body: { body: {
enabled: true, enabled: true,
modelPath: '../models/posenet.json', // can be 'posenet' or 'blazepose' modelPath: '../models/posenet.json', // can be 'posenet' or 'blazepose'
inputSize: 257, // fixed value, 257 for posenet and 256 for blazepose
maxDetections: 10, // maximum number of people detected in the input maxDetections: 10, // maximum number of people detected in the input
// should be set to the minimum number for performance // should be set to the minimum number for performance
// only valid for posenet as blazepose only detects single pose // only valid for posenet as blazepose only detects single pose
scoreThreshold: 0.5, // threshold for deciding when to remove boxes based on score scoreThreshold: 0.3, // threshold for deciding when to remove boxes based on score
// in non-maximum suppression // in non-maximum suppression
// only valid for posenet as blazepose only detects single pose // only valid for posenet as blazepose only detects single pose
nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression nmsRadius: 20, // radius for deciding points are too close in non-maximum suppression
// only valid for posenet as blazepose only detects single pose // only valid for posenet as blazepose only detects single pose
modelType: 'posenet-mobilenet', // can be 'posenet-mobilenet', 'posenet-resnet', 'blazepose'
}, },
hand: { hand: {
enabled: true, enabled: true,
rotation: false, // use best-guess rotated hand image or just box with rotation as-is rotation: false, // use best-guess rotated hand image or just box with rotation as-is
// false means higher performance, but incorrect finger mapping if hand is inverted // false means higher performance, but incorrect finger mapping if hand is inverted
inputSize: 256, // fixed value
skipFrames: 12, // how many frames to go without re-running the hand bounding box detector skipFrames: 12, // how many frames to go without re-running the hand bounding box detector
// only used for video inputs // only used for video inputs
// e.g., if model is running st 25 FPS, we can re-use existing bounding // e.g., if model is running st 25 FPS, we can re-use existing bounding
@ -209,7 +197,7 @@ config = {
modelPath: '../models/handskeleton.json', modelPath: '../models/handskeleton.json',
}, },
}, },
}; }
``` ```
<br> <br>

@ -58,7 +58,7 @@ node demo/node.js
10:28:53.445 Human: setting backend: tensorflow 10:28:53.445 Human: setting backend: tensorflow
10:28:53.505 Human: load model: /models/faceboxes 10:28:53.505 Human: load model: /models/faceboxes
10:28:53.505 Human: load model: /models/iris 10:28:53.505 Human: load model: /models/iris
10:28:53.522 Human: load model: /models/age-ssrnet-imdb 10:28:53.522 Human: load model: /models/age
10:28:53.529 Human: load model: /models/gender 10:28:53.529 Human: load model: /models/gender
10:28:53.535 Human: load model: /models/emotion 10:28:53.535 Human: load model: /models/emotion
10:28:53.607 Human: load model: /models/handdetect 10:28:53.607 Human: load model: /models/handdetect
@ -176,8 +176,8 @@ found 0 vulnerabilities
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 79014 /models/blazeface-back.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 79014 /models/blazeface-back.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 89231 /models/facemesh.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 89231 /models/facemesh.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 121966 /models/iris.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 121966 /models/iris.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 94507 /models/age-ssrnet-imdb.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 94507 /models/age.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 93349 /models/gender-ssrnet-imdb.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 93349 /models/gender.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 17954 /models/emotion.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 17954 /models/emotion.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 48039 /models/posenet.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 48039 /models/posenet.json ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 128180 /models/handdetect.json ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/json 128180 /models/handdetect.json ::ffff:192.168.0.200
@ -185,9 +185,9 @@ found 0 vulnerabilities
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 538928 /models/blazeface-back.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 538928 /models/blazeface-back.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 2599092 /models/iris.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 2599092 /models/iris.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 2955780 /models/facemesh.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 2955780 /models/facemesh.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 161240 /models/age-ssrnet-imdb.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 161240 /models/age.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 5032780 /models/posenet.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 5032780 /models/posenet.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 161236 /models/gender-ssrnet-imdb.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 161236 /models/gender.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 7031064 /models/handdetect.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 7031064 /models/handdetect.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 820516 /models/emotion.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 820516 /models/emotion.bin ::ffff:192.168.0.200
2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 5502280 /models/handskeleton.bin ::ffff:192.168.0.200 2020-12-12 10:12:55 DATA: GET/2.0 200 application/octet-stream 5502280 /models/handskeleton.bin ::ffff:192.168.0.200

@ -40,7 +40,7 @@ Default models in Human library are:
| MediaPipe FaceMesh | 88K | facemesh.json | 2.9M | facemesh.bin | 118 | | MediaPipe FaceMesh | 88K | facemesh.json | 2.9M | facemesh.bin | 118 |
| MediaPipe Iris | 120K | iris.json | 2.5M | iris.bin | 191 | | MediaPipe Iris | 120K | iris.json | 2.5M | iris.bin | 191 |
| Oarriaga Emotion | 18K | emotion.json | 802K | emotion.bin | 23 | | Oarriaga Emotion | 18K | emotion.json | 802K | emotion.bin | 23 |
| SSR-Net Age (IMDB) | 93K | age-ssrnet-imdb.json | 158K | age-ssrnet-imdb.bin | 158 | | SSR-Net Age (IMDB) | 93K | age.json | 158K | age.bin | 158 |
| SSR-Net Gender (IMDB) | 92K | gender-ssrnet-imdb.json | 158K | gender-ssrnet-imdb.bin | 157 | | SSR-Net Gender (IMDB) | 92K | gender-ssrnet-imdb.json | 158K | gender-ssrnet-imdb.bin | 157 |
| Oarriaga Gender | 30K | gender.json | 198K | gender.bin | 39 | | Oarriaga Gender | 30K | gender.json | 198K | gender.bin | 39 |
| PoseNet | 47K | posenet.json | 4.8M | posenet.bin | 62 | | PoseNet | 47K | posenet.json | 4.8M | posenet.bin | 62 |