caching determination is now dynamic based on detection of input change and not based on input types

pull/134/head
Vladimir Mandic 2021-05-18 11:36:24 -04:00
parent a62fc0b7d4
commit dcf3c33382
22 changed files with 4624 additions and 225707 deletions

View File

@ -1,6 +1,6 @@
# @vladmandic/human
Version: **1.8.5**
Version: **1.9.0**
Description: **Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition**
Author: **Vladimir Mandic <mandic00@live.com>**
@ -9,11 +9,14 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
## Changelog
### **human 1.9.0 beta with breaking changes regarding caching** 2021/05/18 mandic00@live.com
### **origin/main** 2021/05/18 mandic00@live.com
### **1.8.5** 2021/05/18 mandic00@live.com
### **origin/main** 2021/05/17 mandic00@live.com
- add node-video sample
- add node-webcam demo
- fix node build and update model signatures

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

75798
dist/human.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

75804
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -127,7 +127,7 @@ var config = {
debug: true,
async: true,
warmup: "full",
cacheSensitivity: 5e-3,
cacheSensitivity: 4e-3,
filter: {
enabled: true,
width: 0,
@ -19601,7 +19601,7 @@ var Human = class {
__privateAdd(this, _skipFrame, async (input) => {
if (this.config.cacheSensitivity === 0)
return true;
const resizeFact = 32;
const resizeFact = 50;
const reduced = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);
const sumT = this.tf.sum(reduced);
reduced.dispose();

View File

@ -128,7 +128,7 @@ var config = {
debug: true,
async: true,
warmup: "full",
cacheSensitivity: 5e-3,
cacheSensitivity: 4e-3,
filter: {
enabled: true,
width: 0,
@ -19602,7 +19602,7 @@ var Human = class {
__privateAdd(this, _skipFrame, async (input) => {
if (this.config.cacheSensitivity === 0)
return true;
const resizeFact = 32;
const resizeFact = 50;
const reduced = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);
const sumT = this.tf.sum(reduced);
reduced.dispose();

4
dist/human.node.js vendored
View File

@ -127,7 +127,7 @@ var config = {
debug: true,
async: true,
warmup: "full",
cacheSensitivity: 5e-3,
cacheSensitivity: 4e-3,
filter: {
enabled: true,
width: 0,
@ -19601,7 +19601,7 @@ var Human = class {
__privateAdd(this, _skipFrame, async (input) => {
if (this.config.cacheSensitivity === 0)
return true;
const resizeFact = 32;
const resizeFact = 50;
const reduced = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);
const sumT = this.tf.sum(reduced);
reduced.dispose();

59191
dist/tfjs.esm.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,3 +15,37 @@
2021-05-18 08:17:00 INFO:  Generate types: ["src/human.ts"]
2021-05-18 08:17:05 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-05-18 08:17:05 INFO:  Generate TypeDocs: ["src/human.ts"]
2021-05-18 11:33:54 INFO:  @vladmandic/human version 1.9.0
2021-05-18 11:33:54 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-05-18 11:33:54 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-05-18 11:33:54 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1284,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:33:54 STATE: Build for: node type: node: {"imports":35,"importBytes":413201,"outputBytes":373086,"outputFiles":"dist/human.node.js"}
2021-05-18 11:33:54 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:33:54 STATE: Build for: nodeGPU type: node: {"imports":35,"importBytes":413209,"outputBytes":373090,"outputFiles":"dist/human.node-gpu.js"}
2021-05-18 11:33:54 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1359,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:33:54 STATE: Build for: nodeWASM type: node: {"imports":35,"importBytes":413276,"outputBytes":373162,"outputFiles":"dist/human.node-wasm.js"}
2021-05-18 11:33:54 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:33:54 STATE: Build for: browserNoBundle type: esm: {"imports":35,"importBytes":413311,"outputBytes":229697,"outputFiles":"dist/human.esm-nobundle.js"}
2021-05-18 11:33:55 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:33:55 STATE: Build for: browserBundle type: iife: {"imports":35,"importBytes":1523331,"outputBytes":1337570,"outputFiles":"dist/human.js"}
2021-05-18 11:33:56 STATE: Build for: browserBundle type: esm: {"imports":35,"importBytes":1523331,"outputBytes":1337562,"outputFiles":"dist/human.esm.js"}
2021-05-18 11:33:56 INFO:  Generate types: ["src/human.ts"]
2021-05-18 11:34:00 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-05-18 11:34:00 INFO:  Generate TypeDocs: ["src/human.ts"]
2021-05-18 11:35:32 INFO:  @vladmandic/human version 1.9.0
2021-05-18 11:35:32 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-05-18 11:35:32 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-05-18 11:35:32 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":39,"outputBytes":1284,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:35:32 STATE: Build for: node type: node: {"imports":35,"importBytes":413201,"outputBytes":373086,"outputFiles":"dist/human.node.js"}
2021-05-18 11:35:32 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":43,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:35:32 STATE: Build for: nodeGPU type: node: {"imports":35,"importBytes":413209,"outputBytes":373090,"outputFiles":"dist/human.node-gpu.js"}
2021-05-18 11:35:32 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":81,"outputBytes":1359,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:35:32 STATE: Build for: nodeWASM type: node: {"imports":35,"importBytes":413276,"outputBytes":373162,"outputFiles":"dist/human.node-wasm.js"}
2021-05-18 11:35:32 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2488,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:35:32 STATE: Build for: browserNoBundle type: esm: {"imports":35,"importBytes":413311,"outputBytes":229697,"outputFiles":"dist/human.esm-nobundle.js"}
2021-05-18 11:35:32 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2488,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"}
2021-05-18 11:35:33 STATE: Build for: browserBundle type: iife: {"imports":35,"importBytes":1523331,"outputBytes":1337570,"outputFiles":"dist/human.js"}
2021-05-18 11:35:33 STATE: Build for: browserBundle type: esm: {"imports":35,"importBytes":1523331,"outputBytes":1337562,"outputFiles":"dist/human.esm.js"}
2021-05-18 11:35:33 INFO:  Generate types: ["src/human.ts"]
2021-05-18 11:35:37 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-05-18 11:35:37 INFO:  Generate TypeDocs: ["src/human.ts"]

View File

@ -201,7 +201,7 @@ const config: Config = {
// warmup pre-initializes all models for faster inference but can take
// significant time on startup
// only used for `webgl` and `humangl` backends
cacheSensitivity: 0.005, // cache sensitivity
cacheSensitivity: 0.004, // cache sensitivity
// values 0..1 where 0.01 means reset cache if input changed more than 1%
// set to 0 to disable caching
filter: { // run input through image filters before inference

View File

@ -344,7 +344,7 @@ export class Human {
/** @hidden */
#skipFrame = async (input) => {
if (this.config.cacheSensitivity === 0) return true;
const resizeFact = 32;
const resizeFact = 50;
const reduced = input.resizeBilinear([Math.trunc(input.shape[1] / resizeFact), Math.trunc(input.shape[2] / resizeFact)]);
const sumT = this.tf.sum(reduced);
reduced.dispose();

View File

@ -167,3 +167,172 @@
2021-05-18 08:20:55 DATA:  test-node-wasm.js result: performance: load: 4 total: 9157
2021-05-18 08:20:55 INFO:  test-node-wasm.js test complete: 31472 ms
2021-05-18 08:20:55 INFO:  status: {"passed":68,"failed":2}
2021-05-18 11:27:34 INFO:  @vladmandic/human version 1.9.0
2021-05-18 11:27:34 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-05-18 11:27:34 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-05-18 11:27:34 INFO:  test-node.js start
2021-05-18 11:27:36 STATE: test-node.js passed: create human
2021-05-18 11:27:36 INFO:  test-node.js human version: 1.9.0
2021-05-18 11:27:36 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0
2021-05-18 11:27:36 INFO:  test-node.js tfjs version: 3.6.0
2021-05-18 11:27:36 STATE: test-node.js passed: set backend: tensorflow
2021-05-18 11:27:36 STATE: test-node.js passed: load models
2021-05-18 11:27:36 STATE: test-node.js result: defined models: 12 loaded models: 6
2021-05-18 11:27:36 STATE: test-node.js passed: warmup: none default
2021-05-18 11:27:38 STATE: test-node.js passed: warmup: face default
2021-05-18 11:27:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5}
2021-05-18 11:27:38 DATA:  test-node.js result: performance: load: 429 total: 1858
2021-05-18 11:27:39 STATE: test-node.js passed: warmup: body default
2021-05-18 11:27:39 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17}
2021-05-18 11:27:39 DATA:  test-node.js result: performance: load: 429 total: 1458
2021-05-18 11:27:39 INFO:  test-node.js test body variants
2021-05-18 11:27:41 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:27:42 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet
2021-05-18 11:27:42 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17}
2021-05-18 11:27:42 DATA:  test-node.js result: performance: load: 429 total: 1053
2021-05-18 11:27:43 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:27:43 STATE: test-node.js passed: detect: assets/human-sample-body.jpg blazepose
2021-05-18 11:27:43 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:43 DATA:  test-node.js result: performance: load: 429 total: 455
2021-05-18 11:27:43 STATE: test-node.js passed: detect: random default
2021-05-18 11:27:43 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 3 {} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:43 DATA:  test-node.js result: performance: load: 429 total: 221
2021-05-18 11:27:43 INFO:  test-node.js test: first instance
2021-05-18 11:27:44 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:27:44 STATE: test-node.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:27:44 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 3 {} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:44 DATA:  test-node.js result: performance: load: 429 total: 175
2021-05-18 11:27:44 INFO:  test-node.js test: second instance
2021-05-18 11:27:44 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:27:46 STATE: test-node.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:27:46 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:46 DATA:  test-node.js result: performance: load: 5 total: 1516
2021-05-18 11:27:46 INFO:  test-node.js test: concurrent
2021-05-18 11:27:46 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:27:46 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:27:47 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:27:48 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 429 total: 5258
2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 5 total: 5258
2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 429 total: 5258
2021-05-18 11:27:53 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:27:53 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:27:53 DATA:  test-node.js result: performance: load: 5 total: 5258
2021-05-18 11:27:53 INFO:  test-node.js test complete: 17450 ms
2021-05-18 11:27:53 INFO:  test-node-gpu.js start
2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.617537: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.792377: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-05-18 11:27:54 WARN:  test-node-gpu.js stderr: 2021-05-18 11:27:54.792495: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist
2021-05-18 11:27:54 STATE: test-node-gpu.js passed: create human
2021-05-18 11:27:54 INFO:  test-node-gpu.js human version: 1.9.0
2021-05-18 11:27:54 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0
2021-05-18 11:27:54 INFO:  test-node-gpu.js tfjs version: 3.6.0
2021-05-18 11:27:55 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-05-18 11:27:55 STATE: test-node-gpu.js passed: load models
2021-05-18 11:27:55 STATE: test-node-gpu.js result: defined models: 12 loaded models: 6
2021-05-18 11:27:55 STATE: test-node-gpu.js passed: warmup: none default
2021-05-18 11:27:56 STATE: test-node-gpu.js passed: warmup: face default
2021-05-18 11:27:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 5 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.52,"class":"person"} {"score":0.96,"keypoints":5}
2021-05-18 11:27:56 DATA:  test-node-gpu.js result: performance: load: 329 total: 1695
2021-05-18 11:27:58 STATE: test-node-gpu.js passed: warmup: body default
2021-05-18 11:27:58 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17}
2021-05-18 11:27:58 DATA:  test-node-gpu.js result: performance: load: 329 total: 1466
2021-05-18 11:27:58 INFO:  test-node-gpu.js test body variants
2021-05-18 11:27:59 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:00 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet
2021-05-18 11:28:00 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":0.91,"keypoints":17}
2021-05-18 11:28:00 DATA:  test-node-gpu.js result: performance: load: 329 total: 1143
2021-05-18 11:28:01 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:02 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg blazepose
2021-05-18 11:28:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:02 DATA:  test-node-gpu.js result: performance: load: 329 total: 462
2021-05-18 11:28:03 STATE: test-node-gpu.js passed: detect: random default
2021-05-18 11:28:03 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39}
2021-05-18 11:28:03 DATA:  test-node-gpu.js result: performance: load: 329 total: 830
2021-05-18 11:28:03 INFO:  test-node-gpu.js test: first instance
2021-05-18 11:28:03 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:28:05 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:28:05 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:05 DATA:  test-node-gpu.js result: performance: load: 329 total: 1490
2021-05-18 11:28:05 INFO:  test-node-gpu.js test: second instance
2021-05-18 11:28:05 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:28:06 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:28:06 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 2 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.7,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:06 DATA:  test-node-gpu.js result: performance: load: 4 total: 1422
2021-05-18 11:28:06 INFO:  test-node-gpu.js test: concurrent
2021-05-18 11:28:06 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:28:06 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:28:07 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:09 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 329 total: 5168
2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.53,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 4 total: 5168
2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 329 total: 5168
2021-05-18 11:28:14 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 3 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.86,"class":"person"} {"score":1,"keypoints":39}
2021-05-18 11:28:14 DATA:  test-node-gpu.js result: performance: load: 4 total: 5168
2021-05-18 11:28:14 INFO:  test-node-gpu.js test complete: 19316 ms
2021-05-18 11:28:14 INFO:  test-node-wasm.js start
2021-05-18 11:28:14 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/
2021-05-18 11:28:14 STATE: test-node-wasm.js passed: create human
2021-05-18 11:28:14 INFO:  test-node-wasm.js human version: 1.9.0
2021-05-18 11:28:14 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0
2021-05-18 11:28:14 INFO:  test-node-wasm.js tfjs version: 3.6.0
2021-05-18 11:28:15 STATE: test-node-wasm.js passed: set backend: wasm
2021-05-18 11:28:15 STATE: test-node-wasm.js passed: load models
2021-05-18 11:28:15 STATE: test-node-wasm.js result: defined models: 12 loaded models: 5
2021-05-18 11:28:15 STATE: test-node-wasm.js passed: warmup: none default
2021-05-18 11:28:15 ERROR: test-node-wasm.js failed: warmup: face default
2021-05-18 11:28:15 ERROR: test-node-wasm.js failed: warmup: body default
2021-05-18 11:28:15 INFO:  test-node-wasm.js test body variants
2021-05-18 11:28:17 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:20 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg posenet
2021-05-18 11:28:20 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":0.91,"keypoints":17}
2021-05-18 11:28:20 DATA:  test-node-wasm.js result: performance: load: 645 total: 3253
2021-05-18 11:28:22 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:24 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg blazepose
2021-05-18 11:28:24 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1} {} {"score":1,"keypoints":39}
2021-05-18 11:28:24 DATA:  test-node-wasm.js result: performance: load: 645 total: 2351
2021-05-18 11:28:26 STATE: test-node-wasm.js passed: detect: random default
2021-05-18 11:28:26 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 {} {} {"score":1,"keypoints":39}
2021-05-18 11:28:26 DATA:  test-node-wasm.js result: performance: load: 645 total: 1749
2021-05-18 11:28:26 INFO:  test-node-wasm.js test: first instance
2021-05-18 11:28:27 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:28:29 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:28:29 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:29 DATA:  test-node-wasm.js result: performance: load: 645 total: 2446
2021-05-18 11:28:29 INFO:  test-node-wasm.js test: second instance
2021-05-18 11:28:30 STATE: test-node-wasm.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-18 11:28:33 STATE: test-node-wasm.js passed: detect: assets/sample-me.jpg default
2021-05-18 11:28:33 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":39.2,"gender":"male"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:33 DATA:  test-node-wasm.js result: performance: load: 5 total: 2416
2021-05-18 11:28:33 INFO:  test-node-wasm.js test: concurrent
2021-05-18 11:28:33 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:28:33 STATE: test-node-wasm.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-18 11:28:35 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:37 STATE: test-node-wasm.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 645 total: 9564
2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-face.jpg default
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 6 object: 0 {"confidence":1,"age":23.6,"gender":"female"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 5 total: 9564
2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 645 total: 9564
2021-05-18 11:28:46 STATE: test-node-wasm.js passed: detect: assets/human-sample-body.jpg default
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 {"confidence":1,"age":28.5,"gender":"female"} {} {"score":1,"keypoints":39}
2021-05-18 11:28:46 DATA:  test-node-wasm.js result: performance: load: 5 total: 9564
2021-05-18 11:28:46 INFO:  test-node-wasm.js test complete: 31985 ms
2021-05-18 11:28:46 INFO:  status: {"passed":68,"failed":2}

File diff suppressed because one or more lines are too long

View File

@ -89,6 +89,7 @@
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#async" class="tsd-kind-icon">async</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#backend" class="tsd-kind-icon">backend</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#body" class="tsd-kind-icon">body</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#cachesensitivity" class="tsd-kind-icon">cache<wbr>Sensitivity</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#debug" class="tsd-kind-icon">debug</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#face" class="tsd-kind-icon">face</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#filter" class="tsd-kind-icon">filter</a></li>
@ -96,7 +97,6 @@
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#hand" class="tsd-kind-icon">hand</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#modelbasepath" class="tsd-kind-icon">model<wbr>Base<wbr>Path</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#object" class="tsd-kind-icon">object</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#videooptimized" class="tsd-kind-icon">video<wbr>Optimized</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#warmup" class="tsd-kind-icon">warmup</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="config.html#wasmpath" class="tsd-kind-icon">wasm<wbr>Path</a></li>
</ul>
@ -165,6 +165,22 @@
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="cachesensitivity" class="tsd-anchor"></a>
<h3>cache<wbr>Sensitivity</h3>
<div class="tsd-signature tsd-kind-icon">cache<wbr>Sensitivity<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Cache sensitivity</p>
<ul>
<li>values 0..1 where 0.01 means reset cache if input changed more than 1%</li>
<li>set to 0 to disable caching</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="debug" class="tsd-anchor"></a>
<h3>debug</h3>
@ -180,7 +196,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="face" class="tsd-anchor"></a>
<h3>face</h3>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>description<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>skipInitial<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>mesh<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">face<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>description<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>mesh<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">
@ -195,8 +211,6 @@
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance</li>
<li>rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles</li>
<li>skipFrames: how many frames to go without re-running the face detector and just run modified face mesh analysis, only valid if videoOptimized is set to true</li>
<li>skipInitial: if previous detection resulted in no faces detected, should skipFrames be reset immediately to force new detection cycle</li>
<li>return: return extracted face as tensor for futher user processing</li>
</ul>
</div>
@ -222,7 +236,7 @@
</ul>
</li>
<li class="tsd-parameter">
<h5>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>skipInitial<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></h5>
<h5>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>return<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></h5>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>iou<wbr>Threshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
@ -245,9 +259,6 @@
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Initial<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
</li>
<li class="tsd-parameter">
@ -487,7 +498,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="hand" class="tsd-anchor"></a>
<h3>hand</h3>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>landmarks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skeleton<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>skipInitial<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">hand<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>detector<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>enabled<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>iouThreshold<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>landmarks<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>maxDetected<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>minConfidence<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>rotation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>skeleton<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>modelPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">; </span>skipFrames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">
@ -501,8 +512,6 @@
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance</li>
<li>rotation: 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</li>
<li>skipFrames: how many frames to go without re-running the hand bounding box detector and just run modified hand skeleton detector, only valid if videoOptimized is set to true</li>
<li>skipInitial: if previous detection resulted in no hands detected, should skipFrames be reset immediately to force new detection cycle</li>
</ul>
</div>
</div>
@ -546,9 +555,6 @@
<li class="tsd-parameter">
<h5>skip<wbr>Frames<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5>
</li>
<li class="tsd-parameter">
<h5>skip<wbr>Initial<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5>
</li>
</ul>
</div>
</section>
@ -582,7 +588,6 @@
<li>minConfidence: minimum score that detection must have to return as valid object</li>
<li>iouThreshold: ammount of overlap between two detected objects before one object is removed</li>
<li>maxDetected: maximum number of detections to return</li>
<li>skipFrames: run object detection every n input frames, only valid if videoOptimized is set to true</li>
</ul>
</div>
</div>
@ -610,24 +615,6 @@
</ul>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="videooptimized" class="tsd-anchor"></a>
<h3>video<wbr>Optimized</h3>
<div class="tsd-signature tsd-kind-icon">video<wbr>Optimized<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Perform additional optimizations when input is video,</p>
<ul>
<li>must be disabled for images</li>
<li>automatically disabled for Image, ImageData, ImageBitmap and Tensor inputs</li>
<li>skips boundary detection for every <code>skipFrames</code> frames specified for each model</li>
<li>while maintaining in-box detection since objects don&#39;t change definition as fast</li>
</ul>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="warmup" class="tsd-anchor"></a>
<h3>warmup</h3>
@ -688,6 +675,9 @@
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#body" class="tsd-kind-icon">body</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#cachesensitivity" class="tsd-kind-icon">cache<wbr>Sensitivity</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#debug" class="tsd-kind-icon">debug</a>
</li>
@ -709,9 +699,6 @@
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#object" class="tsd-kind-icon">object</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#videooptimized" class="tsd-kind-icon">video<wbr>Optimized</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="config.html#warmup" class="tsd-kind-icon">warmup</a>
</li>

18
types/config.d.ts vendored
View File

@ -12,12 +12,6 @@ export interface Config {
debug: boolean;
/** Perform model loading and inference concurrently or sequentially */
async: boolean;
/** Perform additional optimizations when input is video,
* - must be disabled for images
* - automatically disabled for Image, ImageData, ImageBitmap and Tensor inputs
* - skips boundary detection for every `skipFrames` frames specified for each model
* - while maintaining in-box detection since objects don't change definition as fast */
videoOptimized: boolean;
/** What to use for `human.warmup()`
* - warmup pre-initializes all models for faster inference but can take significant time on startup
* - only used for `webgl` and `humangl` backends
@ -27,6 +21,11 @@ export interface Config {
* - individual modelPath values are relative to this path
*/
modelBasePath: string;
/** Cache sensitivity
* - values 0..1 where 0.01 means reset cache if input changed more than 1%
* - set to 0 to disable caching
*/
cacheSensitivity: number;
/** Run input through image filters before inference
* - image filters run with near-zero latency as they are executed on the GPU
*/
@ -88,8 +87,6 @@ export interface Config {
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of faces detected in the input, should be set to the minimum number for performance
* - rotation: use calculated rotated face image or just box with rotation as-is, false means higher performance, but incorrect mesh mapping on higher face angles
* - skipFrames: how many frames to go without re-running the face detector and just run modified face mesh analysis, only valid if videoOptimized is set to true
* - skipInitial: if previous detection resulted in no faces detected, should skipFrames be reset immediately to force new detection cycle
* - return: return extracted face as tensor for futher user processing
*/
face: {
@ -99,7 +96,6 @@ export interface Config {
rotation: boolean;
maxDetected: number;
skipFrames: number;
skipInitial: boolean;
minConfidence: number;
iouThreshold: number;
return: boolean;
@ -145,14 +141,11 @@ export interface Config {
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of hands detected in the input, should be set to the minimum number for performance
* - rotation: 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
* - skipFrames: how many frames to go without re-running the hand bounding box detector and just run modified hand skeleton detector, only valid if videoOptimized is set to true
* - skipInitial: if previous detection resulted in no hands detected, should skipFrames be reset immediately to force new detection cycle
*/
hand: {
enabled: boolean;
rotation: boolean;
skipFrames: number;
skipInitial: boolean;
minConfidence: number;
iouThreshold: number;
maxDetected: number;
@ -170,7 +163,6 @@ export interface Config {
* - minConfidence: minimum score that detection must have to return as valid object
* - iouThreshold: ammount of overlap between two detected objects before one object is removed
* - maxDetected: maximum number of detections to return
* - skipFrames: run object detection every n input frames, only valid if videoOptimized is set to true
*/
object: {
enabled: boolean;

View File

@ -1,2 +1,2 @@
export declare function load(config: any): Promise<any>;
export declare function predict(image: any, config: any): Promise<unknown>;
export declare function predict(image: any, config: any, idx: any, count: any): Promise<unknown>;

View File

@ -14,5 +14,5 @@ export declare function match(embedding: Array<number>, db: DB, threshold?: numb
embedding: number[];
};
export declare function enhance(input: any): Tensor;
export declare function predict(image: any, config: any): Promise<unknown>;
export declare function predict(image: any, config: any, idx: any, count: any): Promise<unknown>;
export {};

2
wiki

@ -1 +1 @@
Subproject commit 3030450d4a177092285d73d313a3efc7c5d8a966
Subproject commit 534d4d77d99b0fc71913e8ef6242e4c6461614f5