mirror of https://github.com/vladmandic/human
fixed memory leaks and updated docs
parent
3b9338d47b
commit
cc936a350f
65
README.md
65
README.md
|
@ -19,6 +19,53 @@ Compatible with *CPU*, *WebGL*, *WASM* and *WebGPU* backends
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
|
Demos are included in `/demo`:
|
||||||
|
|
||||||
|
**Browser**:
|
||||||
|
- `index.html`: Full demo using Browser with ESM module, includes selectable backends and webworkers
|
||||||
|
it loads `dist/demo-browser-index.js` which is built from sources in `demo`, starting with `demo/browser`
|
||||||
|
alternatively you can load `demo/browser.js` directly
|
||||||
|
|
||||||
|
*You can run browser demo either live from git pages, by serving demo folder from your web server or use
|
||||||
|
included micro http2 server with source file monitoring and dynamic rebuild*
|
||||||
|
|
||||||
|
### Dev Server
|
||||||
|
|
||||||
|
To start micro http2 dev server, you must provide your own SSL certificate (production or self-signed)
|
||||||
|
and place them in `dev-server.js`
|
||||||
|
|
||||||
|
Once SSL certificates have been provided, simply run
|
||||||
|
```shell
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
On first start, it will install all development dependencies required to rebuild `Human` library
|
||||||
|
|
||||||
|
```log
|
||||||
|
> @vladmandic/human@0.7.5 dev /home/vlado/dev/human
|
||||||
|
> npm install && node --trace-warnings --unhandled-rejections=strict --trace-uncaught --no-deprecation dev-server.js
|
||||||
|
|
||||||
|
audited 321 packages in 2.506s
|
||||||
|
found 0 vulnerabilities
|
||||||
|
|
||||||
|
2020-11-06 16:19:09 INFO: @vladmandic/human version 0.7.5
|
||||||
|
2020-11-06 16:19:09 INFO: User: vlado Platform: linux Arch: x64 Node: v15.0.1
|
||||||
|
2020-11-06 16:19:09 STATE: HTTP2 server listening: 8000
|
||||||
|
2020-11-06 16:19:09 STATE: Monitoring: [ 'package.json', 'config.js', 'demo', 'src', [length]: 4 ]
|
||||||
|
2020-11-06 16:19:16 DATA: GET/2.0 200 text/html 4866 / ::ffff:192.168.0.200
|
||||||
|
2020-11-06 16:19:16 DATA: GET/2.0 200 text/javascript 1708910 /dist/demo-browser-index.js ::ffff:192.168.0.200
|
||||||
|
```
|
||||||
|
|
||||||
|
*If you want to test `wasm` or `webgpu` backends, enable loading in `index.html`*
|
||||||
|
|
||||||
|
**NodeJS**:
|
||||||
|
- `node.js`: Demo using NodeJS with CommonJS module
|
||||||
|
This is a very simple demo as althought `Human` library is compatible with NodeJS execution
|
||||||
|
and is able to load images and models from local filesystem,
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
**Using static images:**
|
**Using static images:**
|
||||||
|
@ -156,24 +203,6 @@ If your application resides in a different folder, modify `modelPath` property i
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
Demos are included in `/demo`:
|
|
||||||
|
|
||||||
**Browser**:
|
|
||||||
- `index.html`: Full demo using Browser with ESM module, includes selectable backends and webworkers
|
|
||||||
it loads `dist/demo-browser-index.js` which is built from sources in `demo`, starting with `demo/browser`
|
|
||||||
alternatively you can load `demo/browser.js` directly
|
|
||||||
|
|
||||||
*If you want to test `wasm` or `webgpu` backends, enable loading in `index.html`*
|
|
||||||
|
|
||||||
**NodeJS**:
|
|
||||||
- `node.js`: Demo using NodeJS with CommonJS module
|
|
||||||
This is a very simple demo as althought `Human` library is compatible with NodeJS execution
|
|
||||||
and is able to load images and models from local filesystem,
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`Human` library does not require special initialization.
|
`Human` library does not require special initialization.
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -23,7 +23,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"bytes": 3196946,
|
"bytes": 1277930,
|
||||||
"imports": []
|
"imports": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -31,25 +31,28 @@
|
||||||
"dist/demo-browser-index.js.map": {
|
"dist/demo-browser-index.js.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 5559544
|
"bytes": 5531051
|
||||||
},
|
},
|
||||||
"dist/demo-browser-index.js": {
|
"dist/demo-browser-index.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"bytesInOutput": 3194809
|
"bytesInOutput": 1664378
|
||||||
|
},
|
||||||
|
"dist/human.esm.js": {
|
||||||
|
"bytesInOutput": 8716
|
||||||
},
|
},
|
||||||
"demo/draw.js": {
|
"demo/draw.js": {
|
||||||
"bytesInOutput": 7453
|
"bytesInOutput": 7451
|
||||||
},
|
},
|
||||||
"demo/menu.js": {
|
"demo/menu.js": {
|
||||||
"bytesInOutput": 12462
|
"bytesInOutput": 12462
|
||||||
},
|
},
|
||||||
"demo/browser.js": {
|
"demo/browser.js": {
|
||||||
"bytesInOutput": 15800
|
"bytesInOutput": 15781
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 3230646
|
"bytes": 1708910
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 7319,
|
"bytes": 7664,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytes": 3374,
|
"bytes": 3389,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytes": 1746,
|
"bytes": 1766,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytes": 2767,
|
"bytes": 2778,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytes": 6991,
|
"bytes": 7098,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/face/box.js": {
|
"src/face/box.js": {
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytes": 2572,
|
"bytes": 2355,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/blazeface.js"
|
"path": "src/face/blazeface.js"
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytes": 14368,
|
"bytes": 14774,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/box.js"
|
"path": "src/face/box.js"
|
||||||
|
@ -185,8 +185,8 @@
|
||||||
"bytes": 19592,
|
"bytes": 19592,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytes": 2003,
|
"bytes": 3042,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -243,16 +243,16 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytes": 14051,
|
"bytes": 14049,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/facemesh.js"
|
"path": "src/face/facemesh.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/age/ssrnet.js"
|
"path": "src/age/age.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/gender/ssrnet.js"
|
"path": "src/gender/gender.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/emotion/emotion.js"
|
"path": "src/emotion/emotion.js"
|
||||||
|
@ -301,13 +301,13 @@
|
||||||
"dist/human.esm-nobundle.js.map": {
|
"dist/human.esm-nobundle.js.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 619939
|
"bytes": 622186
|
||||||
},
|
},
|
||||||
"dist/human.esm-nobundle.js": {
|
"dist/human.esm-nobundle.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytesInOutput": 3082
|
"bytesInOutput": 3003
|
||||||
},
|
},
|
||||||
"src/face/keypoints.js": {
|
"src/face/keypoints.js": {
|
||||||
"bytesInOutput": 1945
|
"bytesInOutput": 1945
|
||||||
|
@ -319,7 +319,7 @@
|
||||||
"bytesInOutput": 1171
|
"bytesInOutput": 1171
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytesInOutput": 5585
|
"bytesInOutput": 5664
|
||||||
},
|
},
|
||||||
"src/face/uvcoords.js": {
|
"src/face/uvcoords.js": {
|
||||||
"bytesInOutput": 16785
|
"bytesInOutput": 16785
|
||||||
|
@ -328,19 +328,19 @@
|
||||||
"bytesInOutput": 9990
|
"bytesInOutput": 9990
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytesInOutput": 1254
|
"bytesInOutput": 1153
|
||||||
},
|
},
|
||||||
"src/profile.js": {
|
"src/profile.js": {
|
||||||
"bytesInOutput": 618
|
"bytesInOutput": 619
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytesInOutput": 892
|
"bytesInOutput": 915
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytesInOutput": 1028
|
"bytesInOutput": 1392
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytesInOutput": 1344
|
"bytesInOutput": 1356
|
||||||
},
|
},
|
||||||
"src/body/modelBase.js": {
|
"src/body/modelBase.js": {
|
||||||
"bytesInOutput": 455
|
"bytesInOutput": 455
|
||||||
|
@ -403,19 +403,19 @@
|
||||||
"bytesInOutput": 2349
|
"bytesInOutput": 2349
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytesInOutput": 1299
|
"bytesInOutput": 1326
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytesInOutput": 3004
|
"bytesInOutput": 3019
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 7355
|
"bytesInOutput": 7379
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 0
|
"bytesInOutput": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 215895
|
"bytes": 216260
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -288,7 +288,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytes": 7096,
|
"bytes": 7098,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -327,7 +327,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytes": 14674,
|
"bytes": 14774,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -513,178 +513,178 @@
|
||||||
"dist/human.esm.js.map": {
|
"dist/human.esm.js.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 5609921
|
"bytes": 5418171
|
||||||
},
|
},
|
||||||
"dist/human.esm.js": {
|
"dist/human.esm.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js": {
|
"empty:/home/vlado/dev/human/node_modules/node-fetch/browser.js": {
|
||||||
"bytesInOutput": 45
|
"bytesInOutput": 13
|
||||||
},
|
},
|
||||||
"empty:util": {
|
"empty:util": {
|
||||||
"bytesInOutput": 42
|
"bytesInOutput": 13
|
||||||
},
|
},
|
||||||
"empty:crypto": {
|
"empty:crypto": {
|
||||||
"bytesInOutput": 44
|
"bytesInOutput": 13
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js": {
|
"node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js": {
|
||||||
"bytesInOutput": 1010341
|
"bytesInOutput": 295162
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js": {
|
"node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js": {
|
||||||
"bytesInOutput": 514491
|
"bytesInOutput": 238778
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js": {
|
"node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js": {
|
||||||
"bytesInOutput": 258962
|
"bytesInOutput": 115231
|
||||||
},
|
},
|
||||||
"empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js": {
|
"empty:/home/vlado/dev/human/node_modules/string_decoder/lib/string_decoder.js": {
|
||||||
"bytesInOutput": 52
|
"bytesInOutput": 13
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js": {
|
"node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js": {
|
||||||
"bytesInOutput": 129585
|
"bytesInOutput": 52364
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/alea.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/alea.js": {
|
||||||
"bytesInOutput": 2112
|
"bytesInOutput": 990
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xor128.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xor128.js": {
|
||||||
"bytesInOutput": 1699
|
"bytesInOutput": 755
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xorwow.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xorwow.js": {
|
||||||
"bytesInOutput": 1897
|
"bytesInOutput": 845
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xorshift7.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xorshift7.js": {
|
||||||
"bytesInOutput": 2307
|
"bytesInOutput": 1001
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xor4096.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/xor4096.js": {
|
||||||
"bytesInOutput": 2742
|
"bytesInOutput": 1164
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/tychei.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/lib/tychei.js": {
|
||||||
"bytesInOutput": 1940
|
"bytesInOutput": 880
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/seedrandom.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/seedrandom.js": {
|
||||||
"bytesInOutput": 4019
|
"bytesInOutput": 1614
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/index.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/node_modules/seedrandom/index.js": {
|
||||||
"bytesInOutput": 458
|
"bytesInOutput": 171
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
||||||
"bytesInOutput": 272412
|
"bytesInOutput": 82512
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-webgl/dist/tf-backend-webgl.node.js": {
|
"node_modules/@tensorflow/tfjs-backend-webgl/dist/tf-backend-webgl.node.js": {
|
||||||
"bytesInOutput": 561667
|
"bytesInOutput": 261415
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs/dist/tf.node.js": {
|
"node_modules/@tensorflow/tfjs/dist/tf.node.js": {
|
||||||
"bytesInOutput": 3025
|
"bytesInOutput": 760
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytesInOutput": 7010
|
"bytesInOutput": 3012
|
||||||
},
|
},
|
||||||
"src/face/keypoints.js": {
|
"src/face/keypoints.js": {
|
||||||
"bytesInOutput": 2768
|
"bytesInOutput": 1946
|
||||||
},
|
},
|
||||||
"src/face/box.js": {
|
"src/face/box.js": {
|
||||||
"bytesInOutput": 2070
|
"bytesInOutput": 1006
|
||||||
},
|
},
|
||||||
"src/face/util.js": {
|
"src/face/util.js": {
|
||||||
"bytesInOutput": 3017
|
"bytesInOutput": 1190
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytesInOutput": 13458
|
"bytesInOutput": 5656
|
||||||
},
|
},
|
||||||
"src/face/uvcoords.js": {
|
"src/face/uvcoords.js": {
|
||||||
"bytesInOutput": 20584
|
"bytesInOutput": 16786
|
||||||
},
|
},
|
||||||
"src/face/triangulation.js": {
|
"src/face/triangulation.js": {
|
||||||
"bytesInOutput": 23309
|
"bytesInOutput": 9991
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytesInOutput": 2420
|
"bytesInOutput": 1136
|
||||||
},
|
},
|
||||||
"src/profile.js": {
|
"src/profile.js": {
|
||||||
"bytesInOutput": 1092
|
"bytesInOutput": 620
|
||||||
},
|
},
|
||||||
"src/age/age.js": {
|
"src/age/age.js": {
|
||||||
"bytesInOutput": 1744
|
"bytesInOutput": 893
|
||||||
},
|
},
|
||||||
"src/gender/gender.js": {
|
"src/gender/gender.js": {
|
||||||
"bytesInOutput": 2892
|
"bytesInOutput": 1389
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytesInOutput": 2612
|
"bytesInOutput": 1345
|
||||||
},
|
},
|
||||||
"src/body/modelBase.js": {
|
"src/body/modelBase.js": {
|
||||||
"bytesInOutput": 900
|
"bytesInOutput": 433
|
||||||
},
|
},
|
||||||
"src/body/modelMobileNet.js": {
|
"src/body/modelMobileNet.js": {
|
||||||
"bytesInOutput": 494
|
"bytesInOutput": 245
|
||||||
},
|
},
|
||||||
"src/body/heapSort.js": {
|
"src/body/heapSort.js": {
|
||||||
"bytesInOutput": 1637
|
"bytesInOutput": 1042
|
||||||
},
|
},
|
||||||
"src/body/buildParts.js": {
|
"src/body/buildParts.js": {
|
||||||
"bytesInOutput": 1752
|
"bytesInOutput": 547
|
||||||
},
|
},
|
||||||
"src/body/keypoints.js": {
|
"src/body/keypoints.js": {
|
||||||
"bytesInOutput": 2277
|
"bytesInOutput": 1633
|
||||||
},
|
},
|
||||||
"src/body/vectors.js": {
|
"src/body/vectors.js": {
|
||||||
"bytesInOutput": 1408
|
"bytesInOutput": 616
|
||||||
},
|
},
|
||||||
"src/body/decodePose.js": {
|
"src/body/decodePose.js": {
|
||||||
"bytesInOutput": 3773
|
"bytesInOutput": 1024
|
||||||
},
|
},
|
||||||
"src/body/decodeMultiple.js": {
|
"src/body/decodeMultiple.js": {
|
||||||
"bytesInOutput": 1990
|
"bytesInOutput": 604
|
||||||
},
|
},
|
||||||
"src/body/util.js": {
|
"src/body/util.js": {
|
||||||
"bytesInOutput": 2398
|
"bytesInOutput": 1062
|
||||||
},
|
},
|
||||||
"src/body/modelPoseNet.js": {
|
"src/body/modelPoseNet.js": {
|
||||||
"bytesInOutput": 2020
|
"bytesInOutput": 846
|
||||||
},
|
},
|
||||||
"src/body/posenet.js": {
|
"src/body/posenet.js": {
|
||||||
"bytesInOutput": 903
|
"bytesInOutput": 474
|
||||||
},
|
},
|
||||||
"src/hand/box.js": {
|
"src/hand/box.js": {
|
||||||
"bytesInOutput": 3555
|
"bytesInOutput": 1398
|
||||||
},
|
},
|
||||||
"src/hand/handdetector.js": {
|
"src/hand/handdetector.js": {
|
||||||
"bytesInOutput": 4551
|
"bytesInOutput": 1812
|
||||||
},
|
},
|
||||||
"src/hand/util.js": {
|
"src/hand/util.js": {
|
||||||
"bytesInOutput": 3419
|
"bytesInOutput": 1005
|
||||||
},
|
},
|
||||||
"src/hand/handpipeline.js": {
|
"src/hand/handpipeline.js": {
|
||||||
"bytesInOutput": 8366
|
"bytesInOutput": 3055
|
||||||
},
|
},
|
||||||
"src/hand/anchors.js": {
|
"src/hand/anchors.js": {
|
||||||
"bytesInOutput": 256590
|
"bytesInOutput": 127001
|
||||||
},
|
},
|
||||||
"src/hand/handpose.js": {
|
"src/hand/handpose.js": {
|
||||||
"bytesInOutput": 2946
|
"bytesInOutput": 1105
|
||||||
},
|
},
|
||||||
"src/gesture.js": {
|
"src/gesture.js": {
|
||||||
"bytesInOutput": 2270
|
"bytesInOutput": 1220
|
||||||
},
|
},
|
||||||
"src/imagefx.js": {
|
"src/imagefx.js": {
|
||||||
"bytesInOutput": 20097
|
"bytesInOutput": 11014
|
||||||
},
|
},
|
||||||
"src/image.js": {
|
"src/image.js": {
|
||||||
"bytesInOutput": 4482
|
"bytesInOutput": 2365
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytesInOutput": 2277
|
"bytesInOutput": 1327
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytesInOutput": 3533
|
"bytesInOutput": 3020
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 11849
|
"bytesInOutput": 7397
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 0
|
"bytesInOutput": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 3196946
|
"bytes": 1277930
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 7319,
|
"bytes": 7664,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
||||||
|
@ -149,11 +149,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytes": 3374,
|
"bytes": 3389,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytes": 1746,
|
"bytes": 1766,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -277,7 +277,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytes": 2767,
|
"bytes": 2778,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -288,7 +288,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytes": 6991,
|
"bytes": 7098,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -304,7 +304,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytes": 2572,
|
"bytes": 2355,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -327,7 +327,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytes": 14368,
|
"bytes": 14774,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -359,8 +359,8 @@
|
||||||
"bytes": 19592,
|
"bytes": 19592,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytes": 2003,
|
"bytes": 3042,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -433,7 +433,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytes": 14051,
|
"bytes": 14049,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
"path": "node_modules/@tensorflow/tfjs/dist/tf.node.js"
|
||||||
|
@ -442,10 +442,10 @@
|
||||||
"path": "src/face/facemesh.js"
|
"path": "src/face/facemesh.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/age/ssrnet.js"
|
"path": "src/age/age.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/gender/ssrnet.js"
|
"path": "src/gender/gender.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/emotion/emotion.js"
|
"path": "src/emotion/emotion.js"
|
||||||
|
@ -513,7 +513,7 @@
|
||||||
"dist/human.js.map": {
|
"dist/human.js.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 5415915
|
"bytes": 5418167
|
||||||
},
|
},
|
||||||
"dist/human.js": {
|
"dist/human.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
|
@ -567,7 +567,7 @@
|
||||||
"bytesInOutput": 171
|
"bytesInOutput": 171
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
"node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js": {
|
||||||
"bytesInOutput": 82510
|
"bytesInOutput": 82512
|
||||||
},
|
},
|
||||||
"node_modules/@tensorflow/tfjs-backend-webgl/dist/tf-backend-webgl.node.js": {
|
"node_modules/@tensorflow/tfjs-backend-webgl/dist/tf-backend-webgl.node.js": {
|
||||||
"bytesInOutput": 261415
|
"bytesInOutput": 261415
|
||||||
|
@ -576,7 +576,7 @@
|
||||||
"bytesInOutput": 760
|
"bytesInOutput": 760
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytesInOutput": 3093
|
"bytesInOutput": 3012
|
||||||
},
|
},
|
||||||
"src/face/keypoints.js": {
|
"src/face/keypoints.js": {
|
||||||
"bytesInOutput": 1946
|
"bytesInOutput": 1946
|
||||||
|
@ -588,7 +588,7 @@
|
||||||
"bytesInOutput": 1190
|
"bytesInOutput": 1190
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytesInOutput": 5577
|
"bytesInOutput": 5656
|
||||||
},
|
},
|
||||||
"src/face/uvcoords.js": {
|
"src/face/uvcoords.js": {
|
||||||
"bytesInOutput": 16786
|
"bytesInOutput": 16786
|
||||||
|
@ -597,19 +597,19 @@
|
||||||
"bytesInOutput": 9991
|
"bytesInOutput": 9991
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytesInOutput": 1237
|
"bytesInOutput": 1136
|
||||||
},
|
},
|
||||||
"src/profile.js": {
|
"src/profile.js": {
|
||||||
"bytesInOutput": 620
|
"bytesInOutput": 620
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytesInOutput": 877
|
"bytesInOutput": 893
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytesInOutput": 1007
|
"bytesInOutput": 1389
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytesInOutput": 1334
|
"bytesInOutput": 1345
|
||||||
},
|
},
|
||||||
"src/body/modelBase.js": {
|
"src/body/modelBase.js": {
|
||||||
"bytesInOutput": 433
|
"bytesInOutput": 433
|
||||||
|
@ -672,16 +672,16 @@
|
||||||
"bytesInOutput": 2365
|
"bytesInOutput": 2365
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytesInOutput": 1300
|
"bytesInOutput": 1327
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytesInOutput": 3004
|
"bytesInOutput": 3019
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 7412
|
"bytesInOutput": 7435
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 1277602
|
"bytes": 1277975
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytes": 7319,
|
"bytes": 7664,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytes": 3374,
|
"bytes": 3389,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytes": 1746,
|
"bytes": 1766,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytes": 2767,
|
"bytes": 2778,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytes": 6991,
|
"bytes": 7098,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/face/box.js": {
|
"src/face/box.js": {
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytes": 2572,
|
"bytes": 2355,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/blazeface.js"
|
"path": "src/face/blazeface.js"
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytes": 14368,
|
"bytes": 14774,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/box.js"
|
"path": "src/face/box.js"
|
||||||
|
@ -185,8 +185,8 @@
|
||||||
"bytes": 19592,
|
"bytes": 19592,
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytes": 2003,
|
"bytes": 3042,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/profile.js"
|
"path": "src/profile.js"
|
||||||
|
@ -243,16 +243,16 @@
|
||||||
"imports": []
|
"imports": []
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytes": 14051,
|
"bytes": 14049,
|
||||||
"imports": [
|
"imports": [
|
||||||
{
|
{
|
||||||
"path": "src/face/facemesh.js"
|
"path": "src/face/facemesh.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/age/ssrnet.js"
|
"path": "src/age/age.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/gender/ssrnet.js"
|
"path": "src/gender/gender.js"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "src/emotion/emotion.js"
|
"path": "src/emotion/emotion.js"
|
||||||
|
@ -301,13 +301,13 @@
|
||||||
"dist/human.node-nobundle.js.map": {
|
"dist/human.node-nobundle.js.map": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"bytes": 634416
|
"bytes": 636659
|
||||||
},
|
},
|
||||||
"dist/human.node-nobundle.js": {
|
"dist/human.node-nobundle.js": {
|
||||||
"imports": [],
|
"imports": [],
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"src/face/blazeface.js": {
|
"src/face/blazeface.js": {
|
||||||
"bytesInOutput": 3082
|
"bytesInOutput": 3003
|
||||||
},
|
},
|
||||||
"src/face/keypoints.js": {
|
"src/face/keypoints.js": {
|
||||||
"bytesInOutput": 1945
|
"bytesInOutput": 1945
|
||||||
|
@ -319,7 +319,7 @@
|
||||||
"bytesInOutput": 1171
|
"bytesInOutput": 1171
|
||||||
},
|
},
|
||||||
"src/face/facepipeline.js": {
|
"src/face/facepipeline.js": {
|
||||||
"bytesInOutput": 5585
|
"bytesInOutput": 5664
|
||||||
},
|
},
|
||||||
"src/face/uvcoords.js": {
|
"src/face/uvcoords.js": {
|
||||||
"bytesInOutput": 16785
|
"bytesInOutput": 16785
|
||||||
|
@ -328,19 +328,19 @@
|
||||||
"bytesInOutput": 9989
|
"bytesInOutput": 9989
|
||||||
},
|
},
|
||||||
"src/face/facemesh.js": {
|
"src/face/facemesh.js": {
|
||||||
"bytesInOutput": 1254
|
"bytesInOutput": 1158
|
||||||
},
|
},
|
||||||
"src/profile.js": {
|
"src/profile.js": {
|
||||||
"bytesInOutput": 618
|
"bytesInOutput": 619
|
||||||
},
|
},
|
||||||
"src/age/ssrnet.js": {
|
"src/age/age.js": {
|
||||||
"bytesInOutput": 898
|
"bytesInOutput": 915
|
||||||
},
|
},
|
||||||
"src/gender/ssrnet.js": {
|
"src/gender/gender.js": {
|
||||||
"bytesInOutput": 1028
|
"bytesInOutput": 1392
|
||||||
},
|
},
|
||||||
"src/emotion/emotion.js": {
|
"src/emotion/emotion.js": {
|
||||||
"bytesInOutput": 1344
|
"bytesInOutput": 1356
|
||||||
},
|
},
|
||||||
"src/body/modelBase.js": {
|
"src/body/modelBase.js": {
|
||||||
"bytesInOutput": 455
|
"bytesInOutput": 455
|
||||||
|
@ -403,19 +403,19 @@
|
||||||
"bytesInOutput": 2349
|
"bytesInOutput": 2349
|
||||||
},
|
},
|
||||||
"config.js": {
|
"config.js": {
|
||||||
"bytesInOutput": 1298
|
"bytesInOutput": 1325
|
||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
"bytesInOutput": 3004
|
"bytesInOutput": 3019
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 28
|
"bytesInOutput": 28
|
||||||
},
|
},
|
||||||
"src/human.js": {
|
"src/human.js": {
|
||||||
"bytesInOutput": 7355
|
"bytesInOutput": 7379
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bytes": 215903
|
"bytes": 216267
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"name": "Human Library",
|
||||||
|
"short_name": "Human",
|
||||||
|
"icons": [
|
||||||
|
{ "src": "../assets/icon.png", "sizes": "853x853", "type": "image/png", "purpose": "any maskable" }
|
||||||
|
],
|
||||||
|
"start_url": "./index.html",
|
||||||
|
"scope": "/",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#000000",
|
||||||
|
"theme_color": "#000000"
|
||||||
|
}
|
|
@ -97,11 +97,11 @@ class BlazeFaceModel {
|
||||||
}
|
}
|
||||||
const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);
|
const decodedBounds = decodeBounds(prediction, this.anchors, this.inputSize);
|
||||||
const logits = tf.slice(prediction, [0, 0], [-1, 1]);
|
const logits = tf.slice(prediction, [0, 0], [-1, 1]);
|
||||||
|
// activation ('elu'|'hardSigmoid'|'linear'|'relu'|'relu6'| 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh')
|
||||||
// const scoresOut = tf.sigmoid(logits).squeeze();
|
// const scoresOut = tf.sigmoid(logits).squeeze();
|
||||||
const scoresOut = logits.squeeze();
|
const scoresOut = logits.squeeze();
|
||||||
return [prediction, decodedBounds, scoresOut];
|
return [prediction, decodedBounds, scoresOut];
|
||||||
});
|
});
|
||||||
// activation ('elu'|'hardSigmoid'|'linear'|'relu'|'relu6'| 'selu'|'sigmoid'|'softmax'|'softplus'|'softsign'|'tanh')
|
|
||||||
const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.detector.maxFaces, this.config.detector.iouThreshold, this.config.detector.scoreThreshold);
|
const boxIndicesTensor = await tf.image.nonMaxSuppressionAsync(boxes, scores, this.config.detector.maxFaces, this.config.detector.iouThreshold, this.config.detector.scoreThreshold);
|
||||||
const boxIndices = boxIndicesTensor.arraySync();
|
const boxIndices = boxIndicesTensor.arraySync();
|
||||||
boxIndicesTensor.dispose();
|
boxIndicesTensor.dispose();
|
||||||
|
|
|
@ -130,7 +130,6 @@ class Pipeline {
|
||||||
|
|
||||||
async predict(input, config) {
|
async predict(input, config) {
|
||||||
this.runsWithoutFaceDetector += 1;
|
this.runsWithoutFaceDetector += 1;
|
||||||
|
|
||||||
let useFreshBox = (this.detectedFaces === 0) || (this.detectedFaces !== this.regionsOfInterest.length);
|
let useFreshBox = (this.detectedFaces === 0) || (this.detectedFaces !== this.regionsOfInterest.length);
|
||||||
let detector;
|
let detector;
|
||||||
// but every skipFrames check if detect boxes number changed
|
// but every skipFrames check if detect boxes number changed
|
||||||
|
@ -156,15 +155,19 @@ class Pipeline {
|
||||||
const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);
|
const scaledBox = bounding.scaleBoxCoordinates(predictionBox, detector.scaleFactor);
|
||||||
const enlargedBox = bounding.enlargeBox(scaledBox);
|
const enlargedBox = bounding.enlargeBox(scaledBox);
|
||||||
const landmarks = prediction.landmarks.arraySync();
|
const landmarks = prediction.landmarks.arraySync();
|
||||||
prediction.box.startPoint.dispose();
|
|
||||||
prediction.box.endPoint.dispose();
|
|
||||||
prediction.landmarks.dispose();
|
|
||||||
prediction.probability.dispose();
|
|
||||||
return { ...enlargedBox, landmarks };
|
return { ...enlargedBox, landmarks };
|
||||||
});
|
});
|
||||||
this.updateRegionsOfInterest(scaledBoxes);
|
this.updateRegionsOfInterest(scaledBoxes);
|
||||||
this.runsWithoutFaceDetector = 0;
|
this.runsWithoutFaceDetector = 0;
|
||||||
}
|
}
|
||||||
|
if (detector && detector.boxes) {
|
||||||
|
detector.boxes.forEach((prediction) => {
|
||||||
|
prediction.box.startPoint.dispose();
|
||||||
|
prediction.box.endPoint.dispose();
|
||||||
|
prediction.landmarks.dispose();
|
||||||
|
prediction.probability.dispose();
|
||||||
|
});
|
||||||
|
}
|
||||||
let results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {
|
let results = tf.tidy(() => this.regionsOfInterest.map((box, i) => {
|
||||||
let angle = 0;
|
let angle = 0;
|
||||||
// The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).
|
// The facial bounding box landmarks could come either from blazeface (if we are using a fresh box), or from the mesh model (if we are reusing an old box).
|
||||||
|
|
Loading…
Reference in New Issue