modularize model loading

pull/134/head
Vladimir Mandic 2021-06-18 09:16:21 -04:00
parent 9caf2f8b77
commit a251ded89b
22 changed files with 2674 additions and 2632 deletions

View File

@ -9,11 +9,11 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
## Changelog
### **HEAD -> main** 2021/06/18 mandic00@live.com
### **2.0.3** 2021/06/18 mandic00@live.com
### **origin/main** 2021/06/16 mandic00@live.com
- fix demo paths
- added multithreaded demo

View File

@ -52,7 +52,6 @@ Check out [**Live Demo**](https://vladmandic.github.io/human/demo/index.html) ap
- [**NPM Package**](https://www.npmjs.com/package/@vladmandic/human)
- [**Issues Tracker**](https://github.com/vladmandic/human/issues)
- [**TypeDoc API Specification: Human**](https://vladmandic.github.io/human/typedoc/classes/human.html)
- [**TypeDoc API Specification: Root**](https://vladmandic.github.io/human/typedoc/)
- [**Change Log**](https://github.com/vladmandic/human/blob/main/CHANGELOG.md)
- [**Current To-do List**](https://github.com/vladmandic/human/blob/main/TODO.md)

View File

@ -75,7 +75,7 @@ const ui = {
worker: 'index-worker.js',
maxFPSframes: 10, // keep fps history for how many frames
modelsPreload: true, // preload human models on startup
modelsWarmup: true, // warmup human models on startup
modelsWarmup: false, // warmup human models on startup
buffered: true, // should output be buffered between frames
interpolated: true, // should output be interpolated for smoothness between frames
iconSize: '48px', // ui icon sizes
@ -272,7 +272,6 @@ async function drawResults(input) {
if (ui.drawThread) {
log('stopping buffered refresh');
cancelAnimationFrame(ui.drawThread);
ui.drawThread = null;
}
}
}
@ -421,8 +420,13 @@ function webWorker(input, image, canvas, timestamp) {
status();
drawResults(input);
}
// eslint-disable-next-line no-use-before-define
ui.detectThread = requestAnimationFrame((now) => runHumanDetect(input, canvas, now));
const videoLive = (input.readyState > 2) && (!input.paused);
const cameraLive = input.srcObject && (input.srcObject.getVideoTracks()[0].readyState === 'live') && !input.paused;
const live = videoLive || cameraLive;
if (live) {
// eslint-disable-next-line no-use-before-define
ui.detectThread = requestAnimationFrame((now) => runHumanDetect(input, canvas, now));
}
});
}
// pass image data as arraybuffer to worker by reference to avoid copy
@ -437,16 +441,12 @@ function runHumanDetect(input, canvas, timestamp) {
const live = videoLive || cameraLive;
if (!live) {
// stop ui refresh
if (ui.drawThread) cancelAnimationFrame(ui.drawThread);
// if (ui.drawThread) cancelAnimationFrame(ui.drawThread);
if (ui.detectThread) cancelAnimationFrame(ui.detectThread);
ui.drawThread = null;
ui.detectThread = null;
// if we want to continue and camera not ready, retry in 0.5sec, else just give up
if (input.paused) log('video paused');
else if (cameraLive && (input.readyState <= 2)) setTimeout(() => runHumanDetect(input, canvas), 500);
else log(`video not ready: track state: ${input.srcObject ? input.srcObject.getVideoTracks()[0].readyState : 'unknown'} stream state: ${input.readyState}`);
clearTimeout(ui.drawThread);
ui.drawThread = null;
log('frame statistics: process:', ui.framesDetect, 'refresh:', ui.framesDraw);
log('memory', human.tf.engine().memory());
return;
@ -581,10 +581,12 @@ async function detectVideo() {
const video = document.getElementById('video');
const canvas = document.getElementById('canvas');
canvas.style.display = 'block';
cancelAnimationFrame(ui.detectThread);
if ((video.srcObject !== null) && !video.paused) {
document.getElementById('btnStartText').innerHTML = 'start video';
status('paused');
video.pause();
await video.pause();
// if (ui.drawThread) cancelAnimationFrame(ui.drawThread);
} else {
const cameraError = await setupCamera();
if (!cameraError) {
@ -592,7 +594,7 @@ async function detectVideo() {
for (const m of Object.values(menu)) m.hide();
document.getElementById('btnStartText').innerHTML = 'pause video';
await video.play();
if (!ui.detectThread) runHumanDetect(video, canvas);
runHumanDetect(video, canvas);
} else {
status(cameraError);
}
@ -943,6 +945,7 @@ async function main() {
// warmup models
if (ui.modelsWarmup && !ui.useWorker) {
status('initializing');
if (!userConfig.warmup || userConfig.warmup === 'none') userConfig.warmup = 'full';
const res = await human.warmup(userConfig); // this is not required, just pre-warms all models for faster initial inference
if (res && res.canvas && ui.drawWarmup) await drawWarmup(res);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

444
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

444
dist/human.js vendored

File diff suppressed because one or more lines are too long

1243
dist/human.node-gpu.js vendored

File diff suppressed because it is too large Load Diff

1243
dist/human.node-wasm.js vendored

File diff suppressed because it is too large Load Diff

1243
dist/human.node.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,22 @@
2021-06-18 07:23:48 INFO:  @vladmandic/human version 2.0.3
2021-06-18 07:23:49 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-06-18 07:23:49 INFO:  Toolchain: {"tfjs":"3.7.0","esbuild":"0.12.9","typescript":"4.3.4","typedoc":"0.21.0","eslint":"7.28.0"}
2021-06-18 07:23:49 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-06-18 07:23:49 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-06-18 07:23:49 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 07:23:49 STATE: target: node type: node: {"imports":41,"importBytes":430894,"outputBytes":376695,"outputFiles":"dist/human.node.js"}
2021-06-18 07:23:49 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 07:23:49 STATE: target: nodeGPU type: node: {"imports":41,"importBytes":430902,"outputBytes":376699,"outputFiles":"dist/human.node-gpu.js"}
2021-06-18 07:23:49 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 07:23:49 STATE: target: nodeWASM type: node: {"imports":41,"importBytes":430969,"outputBytes":376771,"outputFiles":"dist/human.node-wasm.js"}
2021-06-18 07:23:49 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2817,"outputBytes":1214,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 07:23:49 STATE: target: browserNoBundle type: esm: {"imports":41,"importBytes":430805,"outputBytes":247896,"outputFiles":"dist/human.esm-nobundle.js"}
2021-06-18 07:23:49 STATE: target: browserBundle type: tfjs: {"modules":1684,"moduleBytes":5720339,"imports":7,"importBytes":2817,"outputBytes":2817783,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 07:23:49 STATE: target: browserBundle type: iife: {"imports":41,"importBytes":3247374,"outputBytes":1588289,"outputFiles":"dist/human.js"}
2021-06-18 07:23:50 STATE: target: browserBundle type: esm: {"imports":41,"importBytes":3247374,"outputBytes":1588281,"outputFiles":"dist/human.esm.js"}
2021-06-18 07:23:50 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-06-18 07:24:07 INFO:  Linter complete: files: 73 errors: 0 warnings: 0
2021-06-18 07:24:07 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-06-18 07:24:07 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-06-18 07:24:18 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-06-18 07:24:27 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1
2021-06-18 09:14:08 INFO:  @vladmandic/human version 2.0.3
2021-06-18 09:14:08 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-06-18 09:14:08 INFO:  Toolchain: {"tfjs":"3.7.0","esbuild":"0.12.9","typescript":"4.3.4","typedoc":"0.21.0","eslint":"7.28.0"}
2021-06-18 09:14:08 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-06-18 09:14:08 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-06-18 09:14:08 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 09:14:09 STATE: target: node type: node: {"imports":42,"importBytes":432899,"outputBytes":377119,"outputFiles":"dist/human.node.js"}
2021-06-18 09:14:09 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 09:14:09 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":432907,"outputBytes":377123,"outputFiles":"dist/human.node-gpu.js"}
2021-06-18 09:14:09 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 09:14:09 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":432974,"outputBytes":377195,"outputFiles":"dist/human.node-wasm.js"}
2021-06-18 09:14:09 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2817,"outputBytes":1214,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 09:14:09 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":432810,"outputBytes":247617,"outputFiles":"dist/human.esm-nobundle.js"}
2021-06-18 09:14:09 STATE: target: browserBundle type: tfjs: {"modules":1684,"moduleBytes":5720339,"imports":7,"importBytes":2817,"outputBytes":2817783,"outputFiles":"dist/tfjs.esm.js"}
2021-06-18 09:14:09 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":3249379,"outputBytes":1588012,"outputFiles":"dist/human.js"}
2021-06-18 09:14:10 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":3249379,"outputBytes":1588004,"outputFiles":"dist/human.esm.js"}
2021-06-18 09:14:10 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-06-18 09:14:27 INFO:  Linter complete: files: 74 errors: 0 warnings: 0
2021-06-18 09:14:27 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-06-18 09:14:27 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-06-18 09:14:37 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-06-18 09:14:47 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1

View File

@ -59,7 +59,7 @@ export async function predict(input: Tensor, config: Config): Promise<Face[]> {
return results;
}
export async function load(config): Promise<[unknown, unknown, unknown]> {
export async function load(config): Promise<[unknown, GraphModel | null, GraphModel | null]> {
if ((!faceModels[0] && config.face.enabled) || (!faceModels[1] && config.face.mesh.enabled) || (!faceModels[2] && config.face.iris.enabled)) {
// @ts-ignore type mismatch for GraphModel
faceModels = await Promise.all([

View File

@ -69,7 +69,7 @@ export async function predict(input: Tensor, config: Config): Promise<Hand[]> {
return hands;
}
export async function load(config: Config): Promise<[unknown, unknown]> {
export async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {
if (!handDetectorModel || !handPoseModel) {
// @ts-ignore type mismatch on GraphModel
[handDetectorModel, handPoseModel] = await Promise.all([

View File

@ -8,10 +8,10 @@ import { Result, Gesture } from './result';
import * as sysinfo from './sysinfo';
import * as tf from '../dist/tfjs.esm.js';
import * as backend from './tfjs/backend';
import * as models from './models';
import * as face from './face';
import * as facemesh from './blazeface/facemesh';
import * as faceres from './faceres/faceres';
import * as emotion from './emotion/emotion';
import * as posenet from './posenet/posenet';
import * as handpose from './handpose/handpose';
import * as blazepose from './blazepose/blazepose';
@ -19,15 +19,15 @@ import * as efficientpose from './efficientpose/efficientpose';
import * as movenet from './movenet/movenet';
import * as nanodet from './object/nanodet';
import * as centernet from './object/centernet';
import * as segmentation from './segmentation/segmentation';
import * as gesture from './gesture/gesture';
import * as image from './image/image';
import * as draw from './draw/draw';
import * as persons from './persons';
import * as interpolate from './interpolate';
import * as segmentation from './segmentation/segmentation';
import * as sample from './sample';
import * as app from '../package.json';
import { Tensor } from './tfjs/types';
import { Tensor, GraphModel } from './tfjs/types';
// export types
export type { Config } from './config';
@ -49,11 +49,6 @@ export type Error = { error: string };
*/
export type TensorFlow = typeof tf;
/** Generic Model object type
* holds instance of individual models
*/
type Model = unknown;
/**
* **Human** library main class
*
@ -87,8 +82,8 @@ export class Human {
* - Can be embedded or externally provided
*/
tf: TensorFlow;
/** Draw helper classes that can draw detected objects on canvas using specified draw styles
* - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}
/** Draw helper classes that can draw detected objects on canvas using specified draw
* - options: {@link DrawOptions} global settings for all draw operations, can be overriden for each draw method
* - face: draw detected faces
* - body: draw detected people and body parts
* - hand: draw detected hands and hand parts
@ -106,20 +101,20 @@ export class Human {
};
/** @internal: Currently loaded models */
models: {
face: [Model, Model, Model] | null,
posenet: Model | null,
blazepose: Model | null,
efficientpose: Model | null,
movenet: Model | null,
handpose: [Model, Model] | null,
age: Model | null,
gender: Model | null,
emotion: Model | null,
embedding: Model | null,
nanodet: Model | null,
centernet: Model | null,
faceres: Model | null,
segmentation: Model | null,
face: [unknown, GraphModel | null, GraphModel | null] | null,
posenet: GraphModel | null,
blazepose: GraphModel | null,
efficientpose: GraphModel | null,
movenet: GraphModel | null,
handpose: [GraphModel | null, GraphModel | null] | null,
age: GraphModel | null,
gender: GraphModel | null,
emotion: GraphModel | null,
embedding: GraphModel | null,
nanodet: GraphModel | null,
centernet: GraphModel | null,
faceres: GraphModel | null,
segmentation: GraphModel | null,
};
/** Reference face triangualtion array of 468 points, used for triangle references between points */
faceTriangulation: typeof facemesh.triangulation;
@ -274,47 +269,8 @@ export class Human {
if (this.config.debug) log('tf flags:', this.tf.ENV.flags);
}
}
if (this.config.async) { // load models concurrently
[
// @ts-ignore async model loading is not correctly inferred
this.models.face,
this.models.emotion,
// @ts-ignore async model loading is not correctly inferred
this.models.handpose,
this.models.posenet,
this.models.blazepose,
this.models.efficientpose,
this.models.movenet,
this.models.nanodet,
this.models.centernet,
this.models.faceres,
this.models.segmentation,
] = await Promise.all([
this.models.face || (this.config.face.enabled ? facemesh.load(this.config) : null),
this.models.emotion || ((this.config.face.enabled && this.config.face.emotion.enabled) ? emotion.load(this.config) : null),
this.models.handpose || (this.config.hand.enabled ? handpose.load(this.config) : null),
this.models.posenet || (this.config.body.enabled && this.config.body.modelPath.includes('posenet') ? posenet.load(this.config) : null),
this.models.blazepose || (this.config.body.enabled && this.config.body.modelPath.includes('blazepose') ? blazepose.load(this.config) : null),
this.models.efficientpose || (this.config.body.enabled && this.config.body.modelPath.includes('efficientpose') ? efficientpose.load(this.config) : null),
this.models.movenet || (this.config.body.enabled && this.config.body.modelPath.includes('movenet') ? movenet.load(this.config) : null),
this.models.nanodet || (this.config.object.enabled && this.config.object.modelPath.includes('nanodet') ? nanodet.load(this.config) : null),
this.models.centernet || (this.config.object.enabled && this.config.object.modelPath.includes('centernet') ? centernet.load(this.config) : null),
this.models.faceres || ((this.config.face.enabled && this.config.face.description.enabled) ? faceres.load(this.config) : null),
this.models.segmentation || (this.config.segmentation.enabled ? segmentation.load(this.config) : null),
]);
} else { // load models sequentially
if (this.config.face.enabled && !this.models.face) this.models.face = await facemesh.load(this.config);
if (this.config.face.enabled && this.config.face.emotion.enabled && !this.models.emotion) this.models.emotion = await emotion.load(this.config);
if (this.config.hand.enabled && !this.models.handpose) this.models.handpose = await handpose.load(this.config);
if (this.config.body.enabled && !this.models.posenet && this.config.body.modelPath.includes('posenet')) this.models.posenet = await posenet.load(this.config);
if (this.config.body.enabled && !this.models.blazepose && this.config.body.modelPath.includes('blazepose')) this.models.blazepose = await blazepose.load(this.config);
if (this.config.body.enabled && !this.models.efficientpose && this.config.body.modelPath.includes('efficientpose')) this.models.efficientpose = await blazepose.load(this.config);
if (this.config.body.enabled && !this.models.movenet && this.config.body.modelPath.includes('movenet')) this.models.movenet = await movenet.load(this.config);
if (this.config.object.enabled && !this.models.nanodet && this.config.object.modelPath.includes('nanodet')) this.models.nanodet = await nanodet.load(this.config);
if (this.config.object.enabled && !this.models.centernet && this.config.object.modelPath.includes('centernet')) this.models.centernet = await centernet.load(this.config);
if (this.config.face.enabled && this.config.face.description.enabled && !this.models.faceres) this.models.faceres = await faceres.load(this.config);
if (this.config.segmentation.enabled && !this.models.segmentation) this.models.segmentation = await segmentation.load(this.config);
}
await models.load(this); // actually loads models
if (this.#firstRun) { // print memory stats on first run
if (this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors');
@ -695,7 +651,7 @@ export class Human {
return res;
}
/** Warmup metho pre-initializes all models for faster inference
/** Warmup method pre-initializes all configured models for faster inference
* - can take significant time on startup
* - only used for `webgl` and `humangl` backends
* @param userConfig?: Config

68
src/models.ts Normal file
View File

@ -0,0 +1,68 @@
import * as facemesh from './blazeface/facemesh';
import * as faceres from './faceres/faceres';
import * as emotion from './emotion/emotion';
import * as posenet from './posenet/posenet';
import * as handpose from './handpose/handpose';
import * as blazepose from './blazepose/blazepose';
import * as efficientpose from './efficientpose/efficientpose';
import * as movenet from './movenet/movenet';
import * as nanodet from './object/nanodet';
import * as centernet from './object/centernet';
import * as segmentation from './segmentation/segmentation';
/** Load method preloads all instance.configured models on-demand
* - Not explicitly required as any required model is load implicitly on it's first run
* @param userinstance.config?: {@link instance.config}
*/
export async function load(instance) {
if (instance.config.async) { // load models concurrently
[
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.face,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.emotion,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.handpose,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.posenet,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.blazepose,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.efficientpose,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.movenet,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.nanodet,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.centernet,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.faceres,
// @ts-ignore models loaded via promise array cannot be correctly inferred
instance.models.segmentation,
] = await Promise.all([
instance.models.face || (instance.config.face.enabled ? facemesh.load(instance.config) : null),
instance.models.emotion || ((instance.config.face.enabled && instance.config.face.emotion.enabled) ? emotion.load(instance.config) : null),
instance.models.handpose || (instance.config.hand.enabled ? handpose.load(instance.config) : null),
instance.models.posenet || (instance.config.body.enabled && instance.config.body.modelPath.includes('posenet') ? posenet.load(instance.config) : null),
instance.models.blazepose || (instance.config.body.enabled && instance.config.body.modelPath.includes('blazepose') ? blazepose.load(instance.config) : null),
instance.models.efficientpose || (instance.config.body.enabled && instance.config.body.modelPath.includes('efficientpose') ? efficientpose.load(instance.config) : null),
instance.models.movenet || (instance.config.body.enabled && instance.config.body.modelPath.includes('movenet') ? movenet.load(instance.config) : null),
instance.models.nanodet || (instance.config.object.enabled && instance.config.object.modelPath.includes('nanodet') ? nanodet.load(instance.config) : null),
instance.models.centernet || (instance.config.object.enabled && instance.config.object.modelPath.includes('centernet') ? centernet.load(instance.config) : null),
instance.models.faceres || ((instance.config.face.enabled && instance.config.face.description.enabled) ? faceres.load(instance.config) : null),
instance.models.segmentation || (instance.config.segmentation.enabled ? segmentation.load(instance.config) : null),
]);
} else { // load models sequentially
if (instance.config.face.enabled && !instance.models.face) instance.models.face = await facemesh.load(instance.config);
if (instance.config.face.enabled && instance.config.face.emotion.enabled && !instance.models.emotion) instance.models.emotion = await emotion.load(instance.config);
if (instance.config.hand.enabled && !instance.models.handpose) instance.models.handpose = await handpose.load(instance.config);
if (instance.config.body.enabled && !instance.models.posenet && instance.config.body.modelPath.includes('posenet')) instance.models.posenet = await posenet.load(instance.config);
if (instance.config.body.enabled && !instance.models.blazepose && instance.config.body.modelPath.includes('blazepose')) instance.models.blazepose = await blazepose.load(instance.config);
if (instance.config.body.enabled && !instance.models.efficientpose && instance.config.body.modelPath.includes('efficientpose')) instance.models.efficientpose = await blazepose.load(instance.config);
if (instance.config.body.enabled && !instance.models.movenet && instance.config.body.modelPath.includes('movenet')) instance.models.movenet = await movenet.load(instance.config);
if (instance.config.object.enabled && !instance.models.nanodet && instance.config.object.modelPath.includes('nanodet')) instance.models.nanodet = await nanodet.load(instance.config);
if (instance.config.object.enabled && !instance.models.centernet && instance.config.object.modelPath.includes('centernet')) instance.models.centernet = await centernet.load(instance.config);
if (instance.config.face.enabled && instance.config.face.description.enabled && !instance.models.faceres) instance.models.faceres = await faceres.load(instance.config);
if (instance.config.segmentation.enabled && !instance.models.segmentation) instance.models.segmentation = await segmentation.load(instance.config);
}
}

View File

@ -1,169 +1,169 @@
2021-06-18 07:20:42 INFO:  @vladmandic/human version 2.0.3
2021-06-18 07:20:42 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-06-18 07:20:42 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-06-18 07:20:42 INFO:  test-node.js start
2021-06-18 07:20:42 STATE: test-node.js passed: create human
2021-06-18 07:20:42 INFO:  test-node.js human version: 2.0.3
2021-06-18 07:20:42 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 07:20:42 INFO:  test-node.js tfjs version: 3.7.0
2021-06-18 07:20:43 STATE: test-node.js passed: set backend: tensorflow
2021-06-18 07:20:43 STATE: test-node.js passed: load models
2021-06-18 07:20:43 STATE: test-node.js result: defined models: 14 loaded models: 7
2021-06-18 07:20:43 STATE: test-node.js passed: warmup: none default
2021-06-18 07:20:43 STATE: test-node.js passed: warmup: face default
2021-06-18 07:20:43 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-06-18 07:20:43 DATA:  test-node.js result: performance: load: 212 total: 780
2021-06-18 07:20:44 STATE: test-node.js passed: warmup: body default
2021-06-18 07:20:44 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:44 DATA:  test-node.js result: performance: load: 212 total: 728
2021-06-18 07:20:44 INFO:  test-node.js test body variants
2021-06-18 07:20:45 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:45 STATE: test-node.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 07:20:45 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-06-18 07:20:45 DATA:  test-node.js result: performance: load: 212 total: 539
2021-06-18 07:20:46 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:46 STATE: test-node.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 07:20:46 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:46 DATA:  test-node.js result: performance: load: 212 total: 138
2021-06-18 07:20:47 STATE: test-node.js passed: detect: random default
2021-06-18 07:20:47 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0}
2021-06-18 07:20:47 DATA:  test-node.js result: performance: load: 212 total: 402
2021-06-18 07:20:47 INFO:  test-node.js test: first instance
2021-06-18 07:20:47 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:20:48 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:20:48 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 07:20:48 DATA:  test-node.js result: performance: load: 212 total: 568
2021-06-18 07:20:48 INFO:  test-node.js test: second instance
2021-06-18 07:20:48 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:20:48 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:20:48 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 07:20:48 DATA:  test-node.js result: performance: load: 1 total: 587
2021-06-18 07:20:48 INFO:  test-node.js test: concurrent
2021-06-18 07:20:48 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:20:48 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:20:49 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:50 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:52 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:20:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 07:20:52 DATA:  test-node.js result: performance: load: 212 total: 2523
2021-06-18 07:20:52 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:20:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 07:20:52 DATA:  test-node.js result: performance: load: 1 total: 2523
2021-06-18 07:20:52 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:20:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:52 DATA:  test-node.js result: performance: load: 212 total: 2523
2021-06-18 07:20:52 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:20:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:52 DATA:  test-node.js result: performance: load: 1 total: 2523
2021-06-18 07:20:52 INFO:  test-node.js test complete: 9786 ms
2021-06-18 07:20:52 INFO:  test-node-gpu.js start
2021-06-18 07:20:53 WARN:  test-node-gpu.js stderr: 2021-06-18 07:20:53.148859: 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-06-18 07:20:53 WARN:  test-node-gpu.js stderr: 2021-06-18 07:20:53.184866: 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-06-18 07:20:53 WARN:  test-node-gpu.js stderr: 2021-06-18 07:20:53.184909: 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-06-18 07:20:53 STATE: test-node-gpu.js passed: create human
2021-06-18 07:20:53 INFO:  test-node-gpu.js human version: 2.0.3
2021-06-18 07:20:53 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 07:20:53 INFO:  test-node-gpu.js tfjs version: 3.7.0
2021-06-18 07:20:53 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-06-18 07:20:53 STATE: test-node-gpu.js passed: load models
2021-06-18 07:20:53 STATE: test-node-gpu.js result: defined models: 14 loaded models: 7
2021-06-18 07:20:53 STATE: test-node-gpu.js passed: warmup: none default
2021-06-18 07:20:54 STATE: test-node-gpu.js passed: warmup: face default
2021-06-18 07:20:54 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-06-18 07:20:54 DATA:  test-node-gpu.js result: performance: load: 225 total: 753
2021-06-18 07:20:54 STATE: test-node-gpu.js passed: warmup: body default
2021-06-18 07:20:54 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:54 DATA:  test-node-gpu.js result: performance: load: 225 total: 726
2021-06-18 07:20:54 INFO:  test-node-gpu.js test body variants
2021-06-18 07:20:55 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:56 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 07:20:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-06-18 07:20:56 DATA:  test-node-gpu.js result: performance: load: 225 total: 539
2021-06-18 07:20:56 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:20:56 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 07:20:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:20:56 DATA:  test-node-gpu.js result: performance: load: 225 total: 136
2021-06-18 07:20:57 STATE: test-node-gpu.js passed: detect: random default
2021-06-18 07:20:57 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0}
2021-06-18 07:20:57 DATA:  test-node-gpu.js result: performance: load: 225 total: 404
2021-06-18 07:20:57 INFO:  test-node-gpu.js test: first instance
2021-06-18 07:20:57 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:20:58 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:20:58 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 07:20:58 DATA:  test-node-gpu.js result: performance: load: 225 total: 615
2021-06-18 07:20:58 INFO:  test-node-gpu.js test: second instance
2021-06-18 07:20:58 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:20:59 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:20:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 07:20:59 DATA:  test-node-gpu.js result: performance: load: 3 total: 627
2021-06-18 07:20:59 INFO:  test-node-gpu.js test: concurrent
2021-06-18 07:20:59 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:20:59 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:20:59 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:00 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:03 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: performance: load: 225 total: 2582
2021-06-18 07:21:03 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: performance: load: 3 total: 2582
2021-06-18 07:21:03 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: performance: load: 225 total: 2582
2021-06-18 07:21:03 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 07:21:03 DATA:  test-node-gpu.js result: performance: load: 3 total: 2582
2021-06-18 07:21:03 INFO:  test-node-gpu.js test complete: 9935 ms
2021-06-18 07:21:03 INFO:  test-node-wasm.js start
2021-06-18 07:21:03 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/
2021-06-18 07:21:03 STATE: test-node-wasm.js passed: create human
2021-06-18 07:21:03 INFO:  test-node-wasm.js human version: 2.0.3
2021-06-18 07:21:03 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 07:21:03 INFO:  test-node-wasm.js tfjs version: 3.7.0
2021-06-18 07:21:03 STATE: test-node-wasm.js passed: set backend: wasm
2021-06-18 07:21:03 STATE: test-node-wasm.js passed: load models
2021-06-18 07:21:03 STATE: test-node-wasm.js result: defined models: 14 loaded models: 6
2021-06-18 07:21:03 STATE: test-node-wasm.js passed: warmup: none default
2021-06-18 07:21:03 ERROR: test-node-wasm.js failed: warmup: face default
2021-06-18 07:21:03 ERROR: test-node-wasm.js failed: warmup: body default
2021-06-18 07:21:03 INFO:  test-node-wasm.js test body variants
2021-06-18 07:21:05 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:07 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 07:21:07 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.96,"keypoints":16}
2021-06-18 07:21:07 DATA:  test-node-wasm.js result: performance: load: 404 total: 2180
2021-06-18 07:21:08 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:09 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 07:21:09 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 07:21:09 DATA:  test-node-wasm.js result: performance: load: 404 total: 1389
2021-06-18 07:21:10 STATE: test-node-wasm.js passed: detect: random default
2021-06-18 07:21:10 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 person: 0 {} {} {"score":0.93,"keypoints":17}
2021-06-18 07:21:10 DATA:  test-node-wasm.js result: performance: load: 404 total: 100
2021-06-18 07:21:10 INFO:  test-node-wasm.js test: first instance
2021-06-18 07:21:10 STATE: test-node-wasm.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:21:10 STATE: test-node-wasm.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:21:10 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 person: 0 {} {} {"score":0.78,"keypoints":7}
2021-06-18 07:21:10 DATA:  test-node-wasm.js result: performance: load: 404 total: 218
2021-06-18 07:21:10 INFO:  test-node-wasm.js test: second instance
2021-06-18 07:21:11 STATE: test-node-wasm.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 07:21:12 STATE: test-node-wasm.js passed: detect: samples/ai-upper.jpg default
2021-06-18 07:21:12 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":29.5,"gender":"female"} {} {"score":0.78,"keypoints":7}
2021-06-18 07:21:12 DATA:  test-node-wasm.js result: performance: load: 3 total: 1569
2021-06-18 07:21:12 INFO:  test-node-wasm.js test: concurrent
2021-06-18 07:21:12 STATE: test-node-wasm.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:21:12 STATE: test-node-wasm.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 07:21:13 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:15 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 07:21:21 STATE: test-node-wasm.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 0 person: 1 {"age":23.6,"gender":"female"} {} {"score":0.73,"keypoints":17}
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: performance: load: 404 total: 6225
2021-06-18 07:21:21 STATE: test-node-wasm.js passed: detect: samples/ai-face.jpg default
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 0 person: 1 {"age":23.6,"gender":"female"} {} {"score":0.73,"keypoints":17}
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: performance: load: 3 total: 6225
2021-06-18 07:21:21 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: performance: load: 404 total: 6225
2021-06-18 07:21:21 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg default
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 07:21:21 DATA:  test-node-wasm.js result: performance: load: 3 total: 6225
2021-06-18 07:21:21 INFO:  test-node-wasm.js test complete: 17896 ms
2021-06-18 07:21:21 INFO:  status: {"passed":68,"failed":2}
2021-06-18 09:14:49 INFO:  @vladmandic/human version 2.0.3
2021-06-18 09:14:49 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-06-18 09:14:49 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-06-18 09:14:49 INFO:  test-node.js start
2021-06-18 09:14:51 STATE: test-node.js passed: create human
2021-06-18 09:14:51 INFO:  test-node.js human version: 2.0.3
2021-06-18 09:14:51 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 09:14:51 INFO:  test-node.js tfjs version: 3.7.0
2021-06-18 09:14:51 STATE: test-node.js passed: set backend: tensorflow
2021-06-18 09:14:51 STATE: test-node.js passed: load models
2021-06-18 09:14:51 STATE: test-node.js result: defined models: 14 loaded models: 7
2021-06-18 09:14:51 STATE: test-node.js passed: warmup: none default
2021-06-18 09:14:52 STATE: test-node.js passed: warmup: face default
2021-06-18 09:14:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-06-18 09:14:52 DATA:  test-node.js result: performance: load: 210 total: 870
2021-06-18 09:14:52 STATE: test-node.js passed: warmup: body default
2021-06-18 09:14:52 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:14:52 DATA:  test-node.js result: performance: load: 210 total: 728
2021-06-18 09:14:52 INFO:  test-node.js test body variants
2021-06-18 09:14:53 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:14:54 STATE: test-node.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 09:14:54 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-06-18 09:14:54 DATA:  test-node.js result: performance: load: 210 total: 512
2021-06-18 09:14:54 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:14:54 STATE: test-node.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 09:14:54 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:14:54 DATA:  test-node.js result: performance: load: 210 total: 137
2021-06-18 09:14:55 STATE: test-node.js passed: detect: random default
2021-06-18 09:14:55 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 1 person: 0 {} {"score":0.72,"class":"person"} {"score":0,"keypoints":0}
2021-06-18 09:14:55 DATA:  test-node.js result: performance: load: 210 total: 114
2021-06-18 09:14:55 INFO:  test-node.js test: first instance
2021-06-18 09:14:55 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:14:55 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:14:55 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 1 person: 0 {} {"score":0.72,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 09:14:55 DATA:  test-node.js result: performance: load: 210 total: 96
2021-06-18 09:14:55 INFO:  test-node.js test: second instance
2021-06-18 09:14:55 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:14:56 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:14:56 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 09:14:56 DATA:  test-node.js result: performance: load: 3 total: 624
2021-06-18 09:14:56 INFO:  test-node.js test: concurrent
2021-06-18 09:14:56 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:14:56 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:14:57 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:14:57 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:00 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:00 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 09:15:00 DATA:  test-node.js result: performance: load: 210 total: 2596
2021-06-18 09:15:00 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:00 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 09:15:00 DATA:  test-node.js result: performance: load: 3 total: 2596
2021-06-18 09:15:00 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:00 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:00 DATA:  test-node.js result: performance: load: 210 total: 2596
2021-06-18 09:15:00 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:00 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:00 DATA:  test-node.js result: performance: load: 3 total: 2596
2021-06-18 09:15:00 INFO:  test-node.js test complete: 9310 ms
2021-06-18 09:15:00 INFO:  test-node-gpu.js start
2021-06-18 09:15:00 WARN:  test-node-gpu.js stderr: 2021-06-18 09:15:00.635853: 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-06-18 09:15:00 WARN:  test-node-gpu.js stderr: 2021-06-18 09:15:00.671413: 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-06-18 09:15:00 WARN:  test-node-gpu.js stderr: 2021-06-18 09:15:00.671481: 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-06-18 09:15:00 STATE: test-node-gpu.js passed: create human
2021-06-18 09:15:00 INFO:  test-node-gpu.js human version: 2.0.3
2021-06-18 09:15:00 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 09:15:00 INFO:  test-node-gpu.js tfjs version: 3.7.0
2021-06-18 09:15:00 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-06-18 09:15:00 STATE: test-node-gpu.js passed: load models
2021-06-18 09:15:00 STATE: test-node-gpu.js result: defined models: 14 loaded models: 7
2021-06-18 09:15:00 STATE: test-node-gpu.js passed: warmup: none default
2021-06-18 09:15:01 STATE: test-node-gpu.js passed: warmup: face default
2021-06-18 09:15:01 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-06-18 09:15:01 DATA:  test-node-gpu.js result: performance: load: 210 total: 829
2021-06-18 09:15:02 STATE: test-node-gpu.js passed: warmup: body default
2021-06-18 09:15:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:02 DATA:  test-node-gpu.js result: performance: load: 210 total: 737
2021-06-18 09:15:02 INFO:  test-node-gpu.js test body variants
2021-06-18 09:15:03 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:03 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 09:15:03 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-06-18 09:15:03 DATA:  test-node-gpu.js result: performance: load: 210 total: 552
2021-06-18 09:15:04 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:04 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 09:15:04 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:04 DATA:  test-node-gpu.js result: performance: load: 210 total: 140
2021-06-18 09:15:04 STATE: test-node-gpu.js passed: detect: random default
2021-06-18 09:15:04 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 1 person: 0 {} {"score":0.72,"class":"person"} {"score":0,"keypoints":0}
2021-06-18 09:15:04 DATA:  test-node-gpu.js result: performance: load: 210 total: 118
2021-06-18 09:15:04 INFO:  test-node-gpu.js test: first instance
2021-06-18 09:15:05 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:15:05 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:15:05 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 1 person: 0 {} {"score":0.72,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 09:15:05 DATA:  test-node-gpu.js result: performance: load: 210 total: 93
2021-06-18 09:15:05 INFO:  test-node-gpu.js test: second instance
2021-06-18 09:15:05 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:15:06 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:15:06 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":29.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-06-18 09:15:06 DATA:  test-node-gpu.js result: performance: load: 3 total: 655
2021-06-18 09:15:06 INFO:  test-node-gpu.js test: concurrent
2021-06-18 09:15:06 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:15:06 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:15:06 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:07 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:10 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: performance: load: 210 total: 2595
2021-06-18 09:15:10 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: performance: load: 3 total: 2595
2021-06-18 09:15:10 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: performance: load: 210 total: 2595
2021-06-18 09:15:10 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-06-18 09:15:10 DATA:  test-node-gpu.js result: performance: load: 3 total: 2595
2021-06-18 09:15:10 INFO:  test-node-gpu.js test complete: 9318 ms
2021-06-18 09:15:10 INFO:  test-node-wasm.js start
2021-06-18 09:15:10 STATE: test-node-wasm.js passed: model server: http://localhost:10030/models/
2021-06-18 09:15:10 STATE: test-node-wasm.js passed: create human
2021-06-18 09:15:10 INFO:  test-node-wasm.js human version: 2.0.3
2021-06-18 09:15:10 INFO:  test-node-wasm.js platform: linux x64 agent: NodeJS v16.0.0
2021-06-18 09:15:10 INFO:  test-node-wasm.js tfjs version: 3.7.0
2021-06-18 09:15:10 STATE: test-node-wasm.js passed: set backend: wasm
2021-06-18 09:15:10 STATE: test-node-wasm.js passed: load models
2021-06-18 09:15:10 STATE: test-node-wasm.js result: defined models: 14 loaded models: 6
2021-06-18 09:15:10 STATE: test-node-wasm.js passed: warmup: none default
2021-06-18 09:15:10 ERROR: test-node-wasm.js failed: warmup: face default
2021-06-18 09:15:10 ERROR: test-node-wasm.js failed: warmup: body default
2021-06-18 09:15:10 INFO:  test-node-wasm.js test body variants
2021-06-18 09:15:11 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:14 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg posenet
2021-06-18 09:15:14 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.96,"keypoints":16}
2021-06-18 09:15:14 DATA:  test-node-wasm.js result: performance: load: 397 total: 2185
2021-06-18 09:15:15 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:16 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg movenet
2021-06-18 09:15:16 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 09:15:16 DATA:  test-node-wasm.js result: performance: load: 397 total: 1392
2021-06-18 09:15:16 STATE: test-node-wasm.js passed: detect: random default
2021-06-18 09:15:16 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 person: 0 {} {} {"score":0.93,"keypoints":17}
2021-06-18 09:15:16 DATA:  test-node-wasm.js result: performance: load: 397 total: 112
2021-06-18 09:15:16 INFO:  test-node-wasm.js test: first instance
2021-06-18 09:15:17 STATE: test-node-wasm.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:15:17 STATE: test-node-wasm.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:15:17 DATA:  test-node-wasm.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 0 person: 0 {} {} {"score":0.78,"keypoints":7}
2021-06-18 09:15:17 DATA:  test-node-wasm.js result: performance: load: 397 total: 211
2021-06-18 09:15:17 INFO:  test-node-wasm.js test: second instance
2021-06-18 09:15:17 STATE: test-node-wasm.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-06-18 09:15:19 STATE: test-node-wasm.js passed: detect: samples/ai-upper.jpg default
2021-06-18 09:15:19 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":29.5,"gender":"female"} {} {"score":0.78,"keypoints":7}
2021-06-18 09:15:19 DATA:  test-node-wasm.js result: performance: load: 3 total: 1587
2021-06-18 09:15:19 INFO:  test-node-wasm.js test: concurrent
2021-06-18 09:15:19 STATE: test-node-wasm.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:15:19 STATE: test-node-wasm.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-06-18 09:15:20 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:21 STATE: test-node-wasm.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-06-18 09:15:28 STATE: test-node-wasm.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 0 person: 1 {"age":23.6,"gender":"female"} {} {"score":0.73,"keypoints":17}
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: performance: load: 397 total: 6209
2021-06-18 09:15:28 STATE: test-node-wasm.js passed: detect: samples/ai-face.jpg default
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 0 person: 1 {"age":23.6,"gender":"female"} {} {"score":0.73,"keypoints":17}
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: performance: load: 3 total: 6209
2021-06-18 09:15:28 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: performance: load: 397 total: 6209
2021-06-18 09:15:28 STATE: test-node-wasm.js passed: detect: samples/ai-body.jpg default
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 0 person: 1 {"age":28.5,"gender":"female"} {} {"score":0.93,"keypoints":17}
2021-06-18 09:15:28 DATA:  test-node-wasm.js result: performance: load: 3 total: 6209
2021-06-18 09:15:28 INFO:  test-node-wasm.js test complete: 17910 ms
2021-06-18 09:15:28 INFO:  status: {"passed":68,"failed":2}

View File

@ -185,9 +185,9 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Draw helper classes that can draw detected objects on canvas using specified draw styles</p>
<p>Draw helper classes that can draw detected objects on canvas using specified draw</p>
<ul>
<li>options: global settings for all draw operations, can be overriden for each draw method, for details see <a href="../interfaces/drawoptions.html">DrawOptions</a></li>
<li>options: <a href="../interfaces/drawoptions.html">DrawOptions</a> global settings for all draw operations, can be overriden for each draw method</li>
<li>face: draw detected faces</li>
<li>body: draw detected people and body parts</li>
<li>hand: draw detected hands and hand parts</li>
@ -416,7 +416,7 @@
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="models" class="tsd-anchor"></a>
<h3>models</h3>
<div class="tsd-signature tsd-kind-icon">models<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>age<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>blazepose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>centernet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>efficientpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>embedding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">; </span>faceres<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>gender<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>handpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">; </span>movenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>nanodet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>posenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">; </span>segmentation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">models<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>age<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>blazepose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>centernet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>efficientpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>embedding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">; </span>faceres<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>gender<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>handpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">; </span>movenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>nanodet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>posenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">; </span>segmentation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">
@ -430,46 +430,46 @@
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>age<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>age<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>blazepose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>blazepose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>centernet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>centernet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>efficientpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>efficientpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>embedding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>embedding<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>emotion<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">]</span></h5>
<h5>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">]</span></h5>
</li>
<li class="tsd-parameter">
<h5>faceres<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>faceres<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>gender<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>gender<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>handpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">]</span></h5>
<h5>handpose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span><span class="tsd-signature-symbol">]</span></h5>
</li>
<li class="tsd-parameter">
<h5>movenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>movenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>nanodet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>nanodet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>posenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>posenet<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
<li class="tsd-parameter">
<h5>segmentation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span></h5>
<h5>segmentation<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">GraphModel</span></h5>
</li>
</ul>
</div>
@ -809,7 +809,7 @@
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Warmup metho pre-initializes all models for faster inference</p>
<p>Warmup method pre-initializes all configured models for faster inference</p>
<ul>
<li>can take significant time on startup</li>
<li>only used for <code>webgl</code> and <code>humangl</code> backends</li>

View File

@ -1,10 +1,10 @@
/**
* FaceMesh & BlazeFace Module entry point
*/
import { Tensor } from '../tfjs/types';
import { GraphModel, Tensor } from '../tfjs/types';
import { Face } from '../result';
import { Config } from '../config';
export declare function predict(input: Tensor, config: Config): Promise<Face[]>;
export declare function load(config: any): Promise<[unknown, unknown, unknown]>;
export declare function load(config: any): Promise<[unknown, GraphModel | null, GraphModel | null]>;
export declare const triangulation: number[];
export declare const uvmap: number[][];

View File

@ -2,7 +2,7 @@
* HandPose module entry point
*/
import { Hand } from '../result';
import { Tensor } from '../tfjs/types';
import { Tensor, GraphModel } from '../tfjs/types';
import { Config } from '../config';
export declare function predict(input: Tensor, config: Config): Promise<Hand[]>;
export declare function load(config: Config): Promise<[unknown, unknown]>;
export declare function load(config: Config): Promise<[GraphModel | null, GraphModel | null]>;

40
types/src/human.d.ts vendored
View File

@ -6,7 +6,7 @@ import { Result } from './result';
import * as tf from '../dist/tfjs.esm.js';
import * as facemesh from './blazeface/facemesh';
import * as draw from './draw/draw';
import { Tensor } from './tfjs/types';
import { Tensor, GraphModel } from './tfjs/types';
export type { Config } from './config';
export type { Result, Face, Hand, Body, Item, Gesture, Person } from './result';
export type { DrawOptions } from './draw/draw';
@ -24,10 +24,6 @@ export declare type Error = {
* @external
*/
export declare type TensorFlow = typeof tf;
/** Generic Model object type
* holds instance of individual models
*/
declare type Model = unknown;
/**
* **Human** library main class
*
@ -65,8 +61,8 @@ export declare class Human {
* - Can be embedded or externally provided
*/
tf: TensorFlow;
/** Draw helper classes that can draw detected objects on canvas using specified draw styles
* - options: global settings for all draw operations, can be overriden for each draw method, for details see {@link DrawOptions}
/** Draw helper classes that can draw detected objects on canvas using specified draw
* - options: {@link DrawOptions} global settings for all draw operations, can be overriden for each draw method
* - face: draw detected faces
* - body: draw detected people and body parts
* - hand: draw detected hands and hand parts
@ -84,20 +80,20 @@ export declare class Human {
};
/** @internal: Currently loaded models */
models: {
face: [Model, Model, Model] | null;
posenet: Model | null;
blazepose: Model | null;
efficientpose: Model | null;
movenet: Model | null;
handpose: [Model, Model] | null;
age: Model | null;
gender: Model | null;
emotion: Model | null;
embedding: Model | null;
nanodet: Model | null;
centernet: Model | null;
faceres: Model | null;
segmentation: Model | null;
face: [unknown, GraphModel | null, GraphModel | null] | null;
posenet: GraphModel | null;
blazepose: GraphModel | null;
efficientpose: GraphModel | null;
movenet: GraphModel | null;
handpose: [GraphModel | null, GraphModel | null] | null;
age: GraphModel | null;
gender: GraphModel | null;
emotion: GraphModel | null;
embedding: GraphModel | null;
nanodet: GraphModel | null;
centernet: GraphModel | null;
faceres: GraphModel | null;
segmentation: GraphModel | null;
};
/** Reference face triangualtion array of 468 points, used for triangle references between points */
faceTriangulation: typeof facemesh.triangulation;
@ -180,7 +176,7 @@ export declare class Human {
* @returns result: {@link Result}
*/
detect(input: Input, userConfig?: Config | Record<string, unknown>): Promise<Result | Error>;
/** Warmup metho pre-initializes all models for faster inference
/** Warmup method pre-initializes all configured models for faster inference
* - can take significant time on startup
* - only used for `webgl` and `humangl` backends
* @param userConfig?: Config

5
types/src/models.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/** Load method preloads all instance.configured models on-demand
* - Not explicitly required as any required model is load implicitly on it's first run
* @param userinstance.config?: {@link instance.config}
*/
export declare function load(instance: any): Promise<void>;