mirror of https://github.com/vladmandic/human
quantize handdetect model
parent
8808d66696
commit
08f4e65d81
|
@ -9,8 +9,9 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> main** 2021/05/28 mandic00@live.com
|
||||
### **HEAD -> main** 2021/05/29 mandic00@live.com
|
||||
|
||||
- added experimental movenet-lightning and removed blazepose from default dist
|
||||
- added experimental face.rotation.gaze
|
||||
- fix and optimize for mobile platform
|
||||
- lock typescript to 4.2 due to typedoc incompatibility with 4.3
|
||||
|
|
7
TODO.md
7
TODO.md
|
@ -7,13 +7,12 @@ N/A
|
|||
## Exploring Features
|
||||
|
||||
- Switch from PoseNet to MoveNet
|
||||
- Optimize HandPose
|
||||
- Implement demo as installable PWA with model caching
|
||||
- Implement results interpolation on library level
|
||||
|
||||
## Explore Models
|
||||
|
||||
- InsightFace
|
||||
RetinaFace detector and ArcFace recognition
|
||||
<https://github.com/deepinsight/insightface>
|
||||
- InsightFace: RetinaFace detector and ArcFace recognition: <https://github.com/deepinsight/insightface>
|
||||
|
||||
## In Progress
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import webRTC from './helpers/webrtc.js';
|
|||
let human;
|
||||
|
||||
const userConfig = {
|
||||
warmup: 'none',
|
||||
warmup: 'full',
|
||||
/*
|
||||
backend: 'webgl',
|
||||
async: false,
|
||||
|
@ -33,8 +33,8 @@ const userConfig = {
|
|||
},
|
||||
hand: { enabled: false },
|
||||
// body: { enabled: true, modelPath: 'posenet.json' },
|
||||
body: { enabled: true, modelPath: 'movenet-lightning.json' },
|
||||
// body: { enabled: true, modelPath: 'blazepose.json' },
|
||||
body: { enabled: true, modelPath: 'movenet-lightning.json' },
|
||||
object: { enabled: false },
|
||||
gesture: { enabled: true },
|
||||
*/
|
||||
|
|
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
File diff suppressed because one or more lines are too long
|
@ -185,7 +185,7 @@ var config = {
|
|||
},
|
||||
body: {
|
||||
enabled: true,
|
||||
modelPath: "posenet.json",
|
||||
modelPath: "movenet-lightning.json",
|
||||
maxDetected: 1,
|
||||
minConfidence: 0.2
|
||||
},
|
||||
|
@ -20375,7 +20375,7 @@ var Human = class {
|
|||
}
|
||||
this.perf.total = Math.trunc(now() - timeStart);
|
||||
this.state = "idle";
|
||||
const res = {
|
||||
this.result = {
|
||||
face: faceRes,
|
||||
body: bodyRes,
|
||||
hand: handRes,
|
||||
|
@ -20390,7 +20390,7 @@ var Human = class {
|
|||
}
|
||||
};
|
||||
tf19.dispose(process5.tensor);
|
||||
resolve(res);
|
||||
resolve(this.result);
|
||||
});
|
||||
}
|
||||
async warmup(userConfig = {}) {
|
||||
|
|
|
@ -186,7 +186,7 @@ var config = {
|
|||
},
|
||||
body: {
|
||||
enabled: true,
|
||||
modelPath: "posenet.json",
|
||||
modelPath: "movenet-lightning.json",
|
||||
maxDetected: 1,
|
||||
minConfidence: 0.2
|
||||
},
|
||||
|
@ -20376,7 +20376,7 @@ var Human = class {
|
|||
}
|
||||
this.perf.total = Math.trunc(now() - timeStart);
|
||||
this.state = "idle";
|
||||
const res = {
|
||||
this.result = {
|
||||
face: faceRes,
|
||||
body: bodyRes,
|
||||
hand: handRes,
|
||||
|
@ -20391,7 +20391,7 @@ var Human = class {
|
|||
}
|
||||
};
|
||||
tf19.dispose(process5.tensor);
|
||||
resolve(res);
|
||||
resolve(this.result);
|
||||
});
|
||||
}
|
||||
async warmup(userConfig = {}) {
|
||||
|
|
|
@ -185,7 +185,7 @@ var config = {
|
|||
},
|
||||
body: {
|
||||
enabled: true,
|
||||
modelPath: "posenet.json",
|
||||
modelPath: "movenet-lightning.json",
|
||||
maxDetected: 1,
|
||||
minConfidence: 0.2
|
||||
},
|
||||
|
@ -20375,7 +20375,7 @@ var Human = class {
|
|||
}
|
||||
this.perf.total = Math.trunc(now() - timeStart);
|
||||
this.state = "idle";
|
||||
const res = {
|
||||
this.result = {
|
||||
face: faceRes,
|
||||
body: bodyRes,
|
||||
hand: handRes,
|
||||
|
@ -20390,7 +20390,7 @@ var Human = class {
|
|||
}
|
||||
};
|
||||
tf19.dispose(process5.tensor);
|
||||
resolve(res);
|
||||
resolve(this.result);
|
||||
});
|
||||
}
|
||||
async warmup(userConfig = {}) {
|
||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,17 +1,17 @@
|
|||
2021-05-29 09:19:14 [36mINFO: [39m @vladmandic/human version 1.9.4
|
||||
2021-05-29 09:19:14 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.0.0
|
||||
2021-05-29 09:19:14 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: node type: node: {"imports":39,"importBytes":443616,"outputBytes":396012,"outputFiles":"dist/human.node.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: nodeGPU type: node: {"imports":39,"importBytes":443624,"outputBytes":396016,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: nodeWASM type: node: {"imports":39,"importBytes":443691,"outputBytes":396088,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-05-29 09:19:14 [35mSTATE:[39m Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2478,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 09:19:15 [35mSTATE:[39m Build for: browserNoBundle type: esm: {"imports":39,"importBytes":443718,"outputBytes":242135,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-05-29 09:19:15 [35mSTATE:[39m Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2478,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 09:19:16 [35mSTATE:[39m Build for: browserBundle type: iife: {"imports":39,"importBytes":1553738,"outputBytes":1349942,"outputFiles":"dist/human.js"}
|
||||
2021-05-29 09:19:16 [35mSTATE:[39m Build for: browserBundle type: esm: {"imports":39,"importBytes":1553738,"outputBytes":1349934,"outputFiles":"dist/human.esm.js"}
|
||||
2021-05-29 09:19:16 [36mINFO: [39m Generate types: ["src/human.ts"]
|
||||
2021-05-29 09:19:22 [36mINFO: [39m Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-05-29 09:19:22 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"]
|
||||
2021-05-29 18:28:57 [36mINFO: [39m @vladmandic/human version 1.9.4
|
||||
2021-05-29 18:28:57 [36mINFO: [39m User: vlado Platform: linux Arch: x64 Node: v16.0.0
|
||||
2021-05-29 18:28:57 [36mINFO: [39m Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: node type: node: {"imports":39,"importBytes":443782,"outputBytes":396032,"outputFiles":"dist/human.node.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: nodeGPU type: node: {"imports":39,"importBytes":443790,"outputBytes":396036,"outputFiles":"dist/human.node-gpu.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: nodeWASM type: node: {"imports":39,"importBytes":443857,"outputBytes":396108,"outputFiles":"dist/human.node-wasm.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2478,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 18:28:57 [35mSTATE:[39m Build for: browserNoBundle type: esm: {"imports":39,"importBytes":443884,"outputBytes":242161,"outputFiles":"dist/human.esm-nobundle.js"}
|
||||
2021-05-29 18:28:58 [35mSTATE:[39m Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2478,"outputBytes":1111414,"outputFiles":"dist/tfjs.esm.js"}
|
||||
2021-05-29 18:28:59 [35mSTATE:[39m Build for: browserBundle type: iife: {"imports":39,"importBytes":1553904,"outputBytes":1349968,"outputFiles":"dist/human.js"}
|
||||
2021-05-29 18:28:59 [35mSTATE:[39m Build for: browserBundle type: esm: {"imports":39,"importBytes":1553904,"outputBytes":1349960,"outputFiles":"dist/human.esm.js"}
|
||||
2021-05-29 18:28:59 [36mINFO: [39m Generate types: ["src/human.ts"]
|
||||
2021-05-29 18:29:05 [36mINFO: [39m Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
|
||||
2021-05-29 18:29:05 [36mINFO: [39m Generate TypeDocs: ["src/human.ts"]
|
||||
|
|
|
@ -287,8 +287,8 @@ const config: Config = {
|
|||
|
||||
body: {
|
||||
enabled: true,
|
||||
modelPath: 'posenet.json', // body model, can be absolute path or relative to modelBasePath
|
||||
// can be 'posenet', 'blazepose', 'efficientpose', 'movenet'
|
||||
modelPath: 'movenet-lightning.json', // body model, can be absolute path or relative to modelBasePath
|
||||
// can be 'posenet', 'blazepose', 'efficientpose', 'movenet-lightning', 'movenet-thunder'
|
||||
maxDetected: 1, // maximum number of people detected in the input
|
||||
// should be set to the minimum number for performance
|
||||
// only valid for posenet as other models detects single pose
|
||||
|
|
|
@ -60,6 +60,10 @@ export class Human {
|
|||
* - Details: {@link Config}
|
||||
*/
|
||||
config: Config;
|
||||
/** Last known result of detect run
|
||||
* - Can be accessed anytime after initial detection
|
||||
*/
|
||||
result: Result;
|
||||
/** Current state of Human library
|
||||
* - Can be polled to determine operations that are currently executed
|
||||
*/
|
||||
|
@ -548,7 +552,7 @@ export class Human {
|
|||
|
||||
this.perf.total = Math.trunc(now() - timeStart);
|
||||
this.state = 'idle';
|
||||
const res = {
|
||||
this.result = {
|
||||
face: faceRes,
|
||||
body: bodyRes,
|
||||
hand: handRes,
|
||||
|
@ -564,7 +568,7 @@ export class Human {
|
|||
tf.dispose(process.tensor);
|
||||
|
||||
// log('Result:', result);
|
||||
resolve(res);
|
||||
resolve(this.result);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -105,6 +105,7 @@
|
|||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#image" class="tsd-kind-icon">image</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#models" class="tsd-kind-icon">models</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#perf" class="tsd-kind-icon">perf</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#result" class="tsd-kind-icon">result</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#state" class="tsd-kind-icon">state</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#sysinfo" class="tsd-kind-icon">sysinfo</a></li>
|
||||
<li class="tsd-kind-property tsd-parent-kind-class"><a href="human.html#tf" class="tsd-kind-icon">tf</a></li>
|
||||
|
@ -516,6 +517,21 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
||||
<a name="result" class="tsd-anchor"></a>
|
||||
<h3>result</h3>
|
||||
<div class="tsd-signature tsd-kind-icon">result<span class="tsd-signature-symbol">:</span> <a href="../interfaces/result.html" class="tsd-signature-type" data-tsd-kind="Interface">Result</a></div>
|
||||
<aside class="tsd-sources">
|
||||
</aside>
|
||||
<div class="tsd-comment tsd-typography">
|
||||
<div class="lead">
|
||||
<p>Last known result of detect run</p>
|
||||
<ul>
|
||||
<li>Can be accessed anytime after initial detection</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
|
||||
<a name="state" class="tsd-anchor"></a>
|
||||
<h3>state</h3>
|
||||
|
@ -828,6 +844,9 @@
|
|||
<li class=" tsd-kind-property tsd-parent-kind-class">
|
||||
<a href="human.html#perf" class="tsd-kind-icon">perf</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-class">
|
||||
<a href="human.html#result" class="tsd-kind-icon">result</a>
|
||||
</li>
|
||||
<li class=" tsd-kind-property tsd-parent-kind-class">
|
||||
<a href="human.html#state" class="tsd-kind-icon">state</a>
|
||||
</li>
|
||||
|
|
|
@ -45,6 +45,10 @@ export declare class Human {
|
|||
* - Details: {@link Config}
|
||||
*/
|
||||
config: Config;
|
||||
/** Last known result of detect run
|
||||
* - Can be accessed anytime after initial detection
|
||||
*/
|
||||
result: Result;
|
||||
/** Current state of Human library
|
||||
* - Can be polled to determine operations that are currently executed
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue