update typedoc definitions

pull/134/head
Vladimir Mandic 2021-05-30 18:45:39 -04:00
parent b580ac2c3b
commit c76d5ee5a2
25 changed files with 238 additions and 193 deletions

View File

@ -11,6 +11,7 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
### **HEAD -> main** 2021/05/30 mandic00@live.com ### **HEAD -> main** 2021/05/30 mandic00@live.com
- implemented service worker
- quantized centernet - quantized centernet
- release candidate - release candidate
- added usage restrictions - added usage restrictions

View File

@ -8,6 +8,7 @@
<meta name="application-name" content="Human"> <meta name="application-name" content="Human">
<meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="./manifest.webmanifest"> <link rel="manifest" href="./manifest.webmanifest">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="../assets/icon.png"> <link rel="apple-touch-icon" href="../assets/icon.png">

View File

@ -8,6 +8,7 @@
<meta name="application-name" content="Human"> <meta name="application-name" content="Human">
<meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="./manifest.webmanifest"> <link rel="manifest" href="./manifest.webmanifest">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="../assets/icon.png"> <link rel="apple-touch-icon" href="../assets/icon.png">

View File

@ -1,5 +1,4 @@
/* eslint-disable max-len */ // @ts-nocheck
// based on: https://github.com/munrocket/gl-bench // based on: https://github.com/munrocket/gl-bench
const UICSS = ` const UICSS = `

View File

@ -8,6 +8,7 @@
<meta name="application-name" content="Human"> <meta name="application-name" content="Human">
<meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="description" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>"> <meta name="msapplication-tooltip" content="Human: 3D Face Detection, Body Pose, Hand & Finger Tracking, Iris Tracking, Age & Gender Prediction, Emotion Prediction & Gesture Recognition; Author: Vladimir Mandic <https://github.com/vladmandic>">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="./manifest.webmanifest"> <link rel="manifest" href="./manifest.webmanifest">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="../assets/icon.png"> <link rel="apple-touch-icon" href="../assets/icon.png">

View File

@ -30,6 +30,8 @@ let human;
const userConfig = { const userConfig = {
warmup: 'none', warmup: 'none',
backend: 'webgl', backend: 'webgl',
wasmPath: 'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.6.0/dist/',
/*
async: false, async: false,
cacheSensitivity: 0, cacheSensitivity: 0,
filter: { filter: {
@ -49,6 +51,7 @@ const userConfig = {
body: { enabled: false, modelPath: 'movenet-lightning.json' }, body: { enabled: false, modelPath: 'movenet-lightning.json' },
object: { enabled: false }, object: { enabled: false },
gesture: { enabled: true }, gesture: { enabled: true },
*/
}; };
const drawOptions = { const drawOptions = {

View File

@ -9,6 +9,7 @@
<meta name="keywords" content="Human"> <meta name="keywords" content="Human">
<meta name="description" content="Human; Author: Vladimir Mandic <mandic00@live.com>"> <meta name="description" content="Human; Author: Vladimir Mandic <mandic00@live.com>">
<meta name="msapplication-tooltip" content="Human; Author: Vladimir Mandic <mandic00@live.com>"> <meta name="msapplication-tooltip" content="Human; Author: Vladimir Mandic <mandic00@live.com>">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="manifest.webmanifest"> <link rel="manifest" href="manifest.webmanifest">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" sizes="256x256" href="../assets/icon.png"> <link rel="icon" sizes="256x256" href="../assets/icon.png">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
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

2
dist/human.js vendored

File diff suppressed because one or more lines are too long

View File

@ -123,7 +123,7 @@ function mergeDeep(...objects) {
var config = { var config = {
backend: "webgl", backend: "webgl",
modelBasePath: "../models/", modelBasePath: "../models/",
wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist//", wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist/",
debug: true, debug: true,
async: true, async: true,
warmup: "full", warmup: "full",

View File

@ -124,7 +124,7 @@ function mergeDeep(...objects) {
var config = { var config = {
backend: "webgl", backend: "webgl",
modelBasePath: "../models/", modelBasePath: "../models/",
wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist//", wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist/",
debug: true, debug: true,
async: true, async: true,
warmup: "full", warmup: "full",

2
dist/human.node.js vendored
View File

@ -123,7 +123,7 @@ function mergeDeep(...objects) {
var config = { var config = {
backend: "webgl", backend: "webgl",
modelBasePath: "../models/", modelBasePath: "../models/",
wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist//", wasmPath: "../node_modules/@tensorflow/tfjs-backend-wasm/dist/",
debug: true, debug: true,
async: true, async: true,
warmup: "full", warmup: "full",

View File

@ -1,17 +1,17 @@
2021-05-30 17:55:58 INFO:  @vladmandic/human version 2.0.0 2021-05-30 18:44:01 INFO:  @vladmandic/human version 2.0.0
2021-05-30 17:55:58 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 2021-05-30 18:44:01 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-05-30 17:55:58 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true} 2021-05-30 18:44:01 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-05-30 17:55:58 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"} 2021-05-30 18:44:01 STATE: Build for: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1292,"outputFiles":"dist/tfjs.esm.js"}
2021-05-30 17:55:58 STATE: Build for: node type: node: {"imports":39,"importBytes":446068,"outputBytes":398047,"outputFiles":"dist/human.node.js"} 2021-05-30 18:44:01 STATE: Build for: node type: node: {"imports":39,"importBytes":446470,"outputBytes":398046,"outputFiles":"dist/human.node.js"}
2021-05-30 17:55:58 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"} 2021-05-30 18:44:01 STATE: Build for: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1300,"outputFiles":"dist/tfjs.esm.js"}
2021-05-30 17:55:58 STATE: Build for: nodeGPU type: node: {"imports":39,"importBytes":446076,"outputBytes":398051,"outputFiles":"dist/human.node-gpu.js"} 2021-05-30 18:44:01 STATE: Build for: nodeGPU type: node: {"imports":39,"importBytes":446478,"outputBytes":398050,"outputFiles":"dist/human.node-gpu.js"}
2021-05-30 17:55:58 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"} 2021-05-30 18:44:01 STATE: Build for: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1367,"outputFiles":"dist/tfjs.esm.js"}
2021-05-30 17:55:58 STATE: Build for: nodeWASM type: node: {"imports":39,"importBytes":446143,"outputBytes":398123,"outputFiles":"dist/human.node-wasm.js"} 2021-05-30 18:44:01 STATE: Build for: nodeWASM type: node: {"imports":39,"importBytes":446545,"outputBytes":398122,"outputFiles":"dist/human.node-wasm.js"}
2021-05-30 17:55:58 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2478,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"} 2021-05-30 18:44:01 STATE: Build for: browserNoBundle type: tfjs: {"imports":1,"importBytes":2478,"outputBytes":1394,"outputFiles":"dist/tfjs.esm.js"}
2021-05-30 17:55:58 STATE: Build for: browserNoBundle type: esm: {"imports":39,"importBytes":446170,"outputBytes":243299,"outputFiles":"dist/human.esm-nobundle.js"} 2021-05-30 18:44:02 STATE: Build for: browserNoBundle type: esm: {"imports":39,"importBytes":446572,"outputBytes":243298,"outputFiles":"dist/human.esm-nobundle.js"}
2021-05-30 17:55:59 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2478,"outputBytes":1111418,"outputFiles":"dist/tfjs.esm.js"} 2021-05-30 18:44:02 STATE: Build for: browserBundle type: tfjs: {"modules":1274,"moduleBytes":4114813,"imports":7,"importBytes":2478,"outputBytes":1111418,"outputFiles":"dist/tfjs.esm.js"}
2021-05-30 17:55:59 STATE: Build for: browserBundle type: iife: {"imports":39,"importBytes":1556194,"outputBytes":1351116,"outputFiles":"dist/human.js"} 2021-05-30 18:44:02 STATE: Build for: browserBundle type: iife: {"imports":39,"importBytes":1556596,"outputBytes":1351115,"outputFiles":"dist/human.js"}
2021-05-30 17:56:00 STATE: Build for: browserBundle type: esm: {"imports":39,"importBytes":1556194,"outputBytes":1351108,"outputFiles":"dist/human.esm.js"} 2021-05-30 18:44:03 STATE: Build for: browserBundle type: esm: {"imports":39,"importBytes":1556596,"outputBytes":1351107,"outputFiles":"dist/human.esm.js"}
2021-05-30 17:56:00 INFO:  Generate types: ["src/human.ts"] 2021-05-30 18:44:03 INFO:  Generate types: ["src/human.ts"]
2021-05-30 17:56:05 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"] 2021-05-30 18:44:07 INFO:  Update Change log: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-05-30 17:56:05 INFO:  Generate TypeDocs: ["src/human.ts"] 2021-05-30 18:44:07 INFO:  Generate TypeDocs: ["src/human.ts"]

View File

@ -5,6 +5,7 @@
* Configuration interface definition for **Human** library * Configuration interface definition for **Human** library
* *
* Contains all configurable parameters * Contains all configurable parameters
* @typedef Config
*/ */
export interface Config { export interface Config {
/** Backend used for TFJS operations */ /** Backend used for TFJS operations */
@ -194,7 +195,7 @@ const config: Config = {
backend: 'webgl', // select tfjs backend to use, leave empty to use default backend backend: 'webgl', // select tfjs backend to use, leave empty to use default backend
// can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl // can be 'webgl', 'wasm', 'cpu', or 'humangl' which is a custom version of webgl
modelBasePath: '../models/', // base path for all models modelBasePath: '../models/', // base path for all models
wasmPath: '../node_modules/@tensorflow/tfjs-backend-wasm/dist//', // path for wasm binaries, only used for backend: wasm wasmPath: '../node_modules/@tensorflow/tfjs-backend-wasm/dist/', // path for wasm binaries, only used for backend: wasm
debug: true, // print additional status messages to console debug: true, // print additional status messages to console
async: true, // execute enabled models in parallel async: true, // execute enabled models in parallel
warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full' warmup: 'full', // what to use for human.warmup(), can be 'none', 'face', 'full'

View File

@ -32,10 +32,14 @@ export type { Config } from './config';
export type { Result, Face, Hand, Body, Item, Gesture } from './result'; export type { Result, Face, Hand, Body, Item, Gesture } from './result';
export type { DrawOptions } from './draw/draw'; export type { DrawOptions } from './draw/draw';
/** Defines all possible input types for **Human** detection */ /** Defines all possible input types for **Human** detection
* @typedef Input
*/
export type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas; export type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;
/** Error message */ /** Error message
* @typedef Error
*/
export type Error = { error: string }; export type Error = { error: string };
/** Instance of TensorFlow/JS */ /** Instance of TensorFlow/JS */
@ -52,6 +56,8 @@ type Model = unknown;
* - Configuration object definition: {@link Config} * - Configuration object definition: {@link Config}
* - Results object definition: {@link Result} * - Results object definition: {@link Result}
* - Possible inputs: {@link Input} * - Possible inputs: {@link Input}
*
* @param userConfig: {@link Config}
*/ */
export class Human { export class Human {
/** Current version of Human library in semver format */ /** Current version of Human library in semver format */
@ -68,9 +74,9 @@ export class Human {
* - Can be polled to determine operations that are currently executed * - Can be polled to determine operations that are currently executed
*/ */
state: string; state: string;
/** Internal: Instance of current image being processed */ /** @internal: Instance of current image being processed */
image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null }; image: { tensor: Tensor | null, canvas: OffscreenCanvas | HTMLCanvasElement | null };
/** Internal: Instance of TensorFlow/JS used by Human /** @internal: Instance of TensorFlow/JS used by Human
* - Can be embedded or externally provided * - Can be embedded or externally provided
*/ */
tf: TensorFlow; tf: TensorFlow;
@ -91,7 +97,7 @@ export class Human {
canvas: typeof draw.canvas, canvas: typeof draw.canvas,
all: typeof draw.all, all: typeof draw.all,
}; };
/** Internal: Currently loaded models */ /** @internal: Currently loaded models */
models: { models: {
face: [Model, Model, Model] | null, face: [Model, Model, Model] | null,
posenet: Model | null, posenet: Model | null,
@ -108,7 +114,7 @@ export class Human {
centernet: Model | null, centernet: Model | null,
faceres: Model | null, faceres: Model | null,
}; };
/** Internal: Currently loaded classes */ /** @internal: Currently loaded classes */
classes: { classes: {
facemesh: typeof facemesh; facemesh: typeof facemesh;
emotion: typeof emotion; emotion: typeof emotion;
@ -137,7 +143,7 @@ export class Human {
/** /**
* Creates instance of Human library that is futher used for all operations * Creates instance of Human library that is futher used for all operations
* - @param userConfig: {@link Config} * @param userConfig: {@link Config}
*/ */
constructor(userConfig: Config | Record<string, unknown> = {}) { constructor(userConfig: Config | Record<string, unknown> = {}) {
this.tf = tf; this.tf = tf;
@ -215,6 +221,9 @@ export class Human {
/** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings) /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)
* - Calculation is based on normalized Minkowski distance between * - Calculation is based on normalized Minkowski distance between
* @param embedding1: face descriptor as array of numbers
* @param embedding2: face descriptor as array of numbers
* @returns similarity: number
*/ */
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
similarity(embedding1: Array<number>, embedding2: Array<number>): number { similarity(embedding1: Array<number>, embedding2: Array<number>): number {
@ -222,7 +231,7 @@ export class Human {
} }
/** Enhance method performs additional enhacements to face image previously detected for futher processing /** Enhance method performs additional enhacements to face image previously detected for futher processing
* @param input Tensor as provided in human.result.face[n].tensor * @param input: Tensor as provided in human.result.face[n].tensor
* @returns Tensor * @returns Tensor
*/ */
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
@ -231,8 +240,7 @@ export class Human {
return faceres.enhance(input); return faceres.enhance(input);
} }
/** /** Math method find best match between provided face descriptor and predefined database of known descriptors
* Math method find best match between provided face descriptor and predefined database of known descriptors
* @param faceEmbedding: face descriptor previsouly calculated on any face * @param faceEmbedding: face descriptor previsouly calculated on any face
* @param db: array of mapping of face descriptors to known values * @param db: array of mapping of face descriptors to known values
* @param threshold: minimum score for matching to be considered in the result * @param threshold: minimum score for matching to be considered in the result
@ -245,6 +253,7 @@ export class Human {
/** Load method preloads all configured models on-demand /** Load method preloads all configured models on-demand
* - Not explicitly required as any required model is load implicitly on it's first run * - Not explicitly required as any required model is load implicitly on it's first run
* @param userConfig: {@link Config}
*/ */
async load(userConfig: Config | Record<string, unknown> = {}) { async load(userConfig: Config | Record<string, unknown> = {}) {
this.state = 'load'; this.state = 'load';
@ -404,6 +413,9 @@ export class Human {
* - Pre-process input: {@link Input} * - Pre-process input: {@link Input}
* - Run inference for all configured models * - Run inference for all configured models
* - Process and return result: {@link Result} * - Process and return result: {@link Result}
* @param input: Input
* @param userConfig: Config
* @returns result: Result
*/ */
async detect(input: Input, userConfig: Config | Record<string, unknown> = {}): Promise<Result | Error> { async detect(input: Input, userConfig: Config | Record<string, unknown> = {}): Promise<Result | Error> {
// detection happens inside a promise // detection happens inside a promise
@ -654,6 +666,7 @@ export class Human {
/** Warmup metho pre-initializes all models for faster inference /** Warmup metho pre-initializes all models for faster inference
* - can take significant time on startup * - can take significant time on startup
* - only used for `webgl` and `humangl` backends * - only used for `webgl` and `humangl` backends
* @param userConfig: Config
*/ */
async warmup(userConfig: Config | Record<string, unknown> = {}): Promise<Result | { error }> { async warmup(userConfig: Config | Record<string, unknown> = {}): Promise<Result | { error }> {
const t0 = now(); const t0 = now();

View File

@ -1,5 +1,5 @@
/** /**
* Type definitions for Human results * Type definitions for Human result object
*/ */
import { Tensor } from '../dist/tfjs.esm.js'; import { Tensor } from '../dist/tfjs.esm.js';

View File

@ -5,6 +5,7 @@ const config = {
modelBasePath: 'http://localhost:10030/models/', modelBasePath: 'http://localhost:10030/models/',
backend: 'wasm', backend: 'wasm',
wasmPath: 'node_modules/@tensorflow/tfjs-backend-wasm/dist/', wasmPath: 'node_modules/@tensorflow/tfjs-backend-wasm/dist/',
// wasmPath: 'https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.6.0/dist/',
debug: false, debug: false,
async: false, async: false,
filter: { filter: {

View File

@ -1,120 +1,120 @@
2021-05-29 18:30:17 INFO:  @vladmandic/human version 1.9.4 2021-05-30 18:44:32 INFO:  @vladmandic/human version 2.0.0
2021-05-29 18:30:17 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0 2021-05-30 18:44:32 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.0.0
2021-05-29 18:30:17 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"] 2021-05-30 18:44:32 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-05-29 18:30:17 INFO:  test-node.js start 2021-05-30 18:44:32 INFO:  test-node.js start
2021-05-29 18:30:19 STATE: test-node.js passed: create human 2021-05-30 18:44:34 STATE: test-node.js passed: create human
2021-05-29 18:30:19 INFO:  test-node.js human version: 1.9.4 2021-05-30 18:44:34 INFO:  test-node.js human version: 2.0.0
2021-05-29 18:30:19 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0 2021-05-30 18:44:34 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.0.0
2021-05-29 18:30:19 INFO:  test-node.js tfjs version: 3.6.0 2021-05-30 18:44:34 INFO:  test-node.js tfjs version: 3.6.0
2021-05-29 18:30:19 STATE: test-node.js passed: set backend: tensorflow 2021-05-30 18:44:34 STATE: test-node.js passed: set backend: tensorflow
2021-05-29 18:30:19 STATE: test-node.js passed: load models 2021-05-30 18:44:34 STATE: test-node.js passed: load models
2021-05-29 18:30:19 STATE: test-node.js result: defined models: 14 loaded models: 6 2021-05-30 18:44:34 STATE: test-node.js result: defined models: 14 loaded models: 6
2021-05-29 18:30:19 STATE: test-node.js passed: warmup: none default 2021-05-30 18:44:34 STATE: test-node.js passed: warmup: none default
2021-05-29 18:30:21 STATE: test-node.js passed: warmup: face default 2021-05-30 18:44:36 STATE: test-node.js passed: warmup: face default
2021-05-29 18:30:21 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8246909379959106,"class":"person"} {"score":0.73,"keypoints":5} 2021-05-30 18:44:36 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-05-29 18:30:21 DATA:  test-node.js result: performance: load: 345 total: 1666 2021-05-30 18:44:36 DATA:  test-node.js result: performance: load: 351 total: 1597
2021-05-29 18:30:22 STATE: test-node.js passed: warmup: body default 2021-05-30 18:44:38 STATE: test-node.js passed: warmup: body default
2021-05-29 18:30:22 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.7261000871658325,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:22 DATA:  test-node.js result: performance: load: 345 total: 1523 2021-05-30 18:44:38 DATA:  test-node.js result: performance: load: 351 total: 1550
2021-05-29 18:30:22 INFO:  test-node.js test body variants 2021-05-30 18:44:38 INFO:  test-node.js test body variants
2021-05-29 18:30:23 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:39 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:24 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet 2021-05-30 18:44:40 STATE: test-node.js passed: detect: assets/human-sample-body.jpg posenet
2021-05-29 18:30:24 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.96,"keypoints":16} 2021-05-30 18:44:40 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-05-29 18:30:24 DATA:  test-node.js result: performance: load: 345 total: 987 2021-05-30 18:44:40 DATA:  test-node.js result: performance: load: 351 total: 950
2021-05-29 18:30:25 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:40 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:26 STATE: test-node.js passed: detect: assets/human-sample-body.jpg movenet 2021-05-30 18:44:41 STATE: test-node.js passed: detect: assets/human-sample-body.jpg movenet
2021-05-29 18:30:26 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:41 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:26 DATA:  test-node.js result: performance: load: 345 total: 318 2021-05-30 18:44:41 DATA:  test-node.js result: performance: load: 351 total: 386
2021-05-29 18:30:27 STATE: test-node.js passed: detect: random default 2021-05-30 18:44:41 STATE: test-node.js passed: detect: random default
2021-05-29 18:30:27 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} 2021-05-30 18:44:41 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-05-29 18:30:27 DATA:  test-node.js result: performance: load: 345 total: 788 2021-05-30 18:44:41 DATA:  test-node.js result: performance: load: 351 total: 181
2021-05-29 18:30:27 INFO:  test-node.js test: first instance 2021-05-30 18:44:41 INFO:  test-node.js test: first instance
2021-05-29 18:30:27 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] 2021-05-30 18:44:42 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-29 18:30:28 STATE: test-node.js passed: detect: assets/sample-me.jpg default 2021-05-30 18:44:42 STATE: test-node.js passed: detect: assets/sample-me.jpg default
2021-05-29 18:30:28 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":0.67,"keypoints":7} 2021-05-30 18:44:42 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 1 object: 1 person: 0 {} {"score":0.72,"class":"person"} {"score":0.67,"keypoints":7}
2021-05-29 18:30:28 DATA:  test-node.js result: performance: load: 345 total: 1516 2021-05-30 18:44:42 DATA:  test-node.js result: performance: load: 351 total: 113
2021-05-29 18:30:28 INFO:  test-node.js test: second instance 2021-05-30 18:44:42 INFO:  test-node.js test: second instance
2021-05-29 18:30:29 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3] 2021-05-30 18:44:42 STATE: test-node.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-29 18:30:30 STATE: test-node.js passed: detect: assets/sample-me.jpg default 2021-05-30 18:44:43 STATE: test-node.js passed: detect: assets/sample-me.jpg default
2021-05-29 18:30:30 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":0.67,"keypoints":7} 2021-05-30 18:44:43 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.68,"class":"person"} {"score":0.67,"keypoints":7}
2021-05-29 18:30:30 DATA:  test-node.js result: performance: load: 7 total: 1435 2021-05-30 18:44:43 DATA:  test-node.js result: performance: load: 3 total: 1446
2021-05-29 18:30:30 INFO:  test-node.js test: concurrent 2021-05-30 18:44:43 INFO:  test-node.js test: concurrent
2021-05-29 18:30:30 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] 2021-05-30 18:44:44 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-29 18:30:30 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] 2021-05-30 18:44:44 STATE: test-node.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-29 18:30:31 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:45 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:32 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:46 STATE: test-node.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:38 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default 2021-05-30 18:44:51 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default
2021-05-29 18:30:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":0.73,"keypoints":17} 2021-05-30 18:44:51 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-05-29 18:30:38 DATA:  test-node.js result: performance: load: 345 total: 5657 2021-05-30 18:44:51 DATA:  test-node.js result: performance: load: 351 total: 5303
2021-05-29 18:30:38 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default 2021-05-30 18:44:51 STATE: test-node.js passed: detect: assets/human-sample-face.jpg default
2021-05-29 18:30:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":0.73,"keypoints":17} 2021-05-30 18:44:51 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-05-29 18:30:38 DATA:  test-node.js result: performance: load: 7 total: 5657 2021-05-30 18:44:51 DATA:  test-node.js result: performance: load: 3 total: 5303
2021-05-29 18:30:38 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default 2021-05-30 18:44:51 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default
2021-05-29 18:30:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:51 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:38 DATA:  test-node.js result: performance: load: 345 total: 5657 2021-05-30 18:44:51 DATA:  test-node.js result: performance: load: 351 total: 5303
2021-05-29 18:30:38 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default 2021-05-30 18:44:51 STATE: test-node.js passed: detect: assets/human-sample-body.jpg default
2021-05-29 18:30:38 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:51 DATA:  test-node.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:38 DATA:  test-node.js result: performance: load: 7 total: 5657 2021-05-30 18:44:51 DATA:  test-node.js result: performance: load: 3 total: 5303
2021-05-29 18:30:38 INFO:  test-node.js test complete: 19401 ms 2021-05-30 18:44:51 INFO:  test-node.js test complete: 16908 ms
2021-05-29 18:30:38 INFO:  test-node-gpu.js start 2021-05-30 18:44:51 INFO:  test-node-gpu.js start
2021-05-29 18:30:39 WARN:  test-node-gpu.js stderr: 2021-05-29 18:30:39.644962: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2021-05-30 18:44:52 WARN:  test-node-gpu.js stderr: 2021-05-30 18:44:52.591364: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-05-29 18:30:39 WARN:  test-node-gpu.js stderr: 2021-05-29 18:30:39.887957: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory 2021-05-30 18:44:52 WARN:  test-node-gpu.js stderr: 2021-05-30 18:44:52.796392: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-05-29 18:30:39 WARN:  test-node-gpu.js stderr: 2021-05-29 18:30:39.888022: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist 2021-05-30 18:44:52 WARN:  test-node-gpu.js stderr: 2021-05-30 18:44:52.796422: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (wyse): /proc/driver/nvidia/version does not exist
2021-05-29 18:30:39 STATE: test-node-gpu.js passed: create human 2021-05-30 18:44:52 STATE: test-node-gpu.js passed: create human
2021-05-29 18:30:39 INFO:  test-node-gpu.js human version: 1.9.4 2021-05-30 18:44:52 INFO:  test-node-gpu.js human version: 2.0.0
2021-05-29 18:30:39 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0 2021-05-30 18:44:52 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.0.0
2021-05-29 18:30:39 INFO:  test-node-gpu.js tfjs version: 3.6.0 2021-05-30 18:44:52 INFO:  test-node-gpu.js tfjs version: 3.6.0
2021-05-29 18:30:40 STATE: test-node-gpu.js passed: set backend: tensorflow 2021-05-30 18:44:53 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-05-29 18:30:40 STATE: test-node-gpu.js passed: load models 2021-05-30 18:44:53 STATE: test-node-gpu.js passed: load models
2021-05-29 18:30:40 STATE: test-node-gpu.js result: defined models: 14 loaded models: 6 2021-05-30 18:44:53 STATE: test-node-gpu.js result: defined models: 14 loaded models: 6
2021-05-29 18:30:40 STATE: test-node-gpu.js passed: warmup: none default 2021-05-30 18:44:53 STATE: test-node-gpu.js passed: warmup: none default
2021-05-29 18:30:42 STATE: test-node-gpu.js passed: warmup: face default 2021-05-30 18:44:54 STATE: test-node-gpu.js passed: warmup: face default
2021-05-29 18:30:42 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8246909379959106,"class":"person"} {"score":0.73,"keypoints":5} 2021-05-30 18:44:55 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":5}
2021-05-29 18:30:42 DATA:  test-node-gpu.js result: performance: load: 348 total: 1692 2021-05-30 18:44:55 DATA:  test-node-gpu.js result: performance: load: 337 total: 1707
2021-05-29 18:30:43 STATE: test-node-gpu.js passed: warmup: body default 2021-05-30 18:44:56 STATE: test-node-gpu.js passed: warmup: body default
2021-05-29 18:30:43 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.7261000871658325,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:56 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":29.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:43 DATA:  test-node-gpu.js result: performance: load: 348 total: 1521 2021-05-30 18:44:56 DATA:  test-node-gpu.js result: performance: load: 337 total: 1518
2021-05-29 18:30:43 INFO:  test-node-gpu.js test body variants 2021-05-30 18:44:56 INFO:  test-node-gpu.js test body variants
2021-05-29 18:30:44 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:57 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:45 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet 2021-05-30 18:44:58 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg posenet
2021-05-29 18:30:45 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.96,"keypoints":16} 2021-05-30 18:44:58 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.72,"class":"person"} {"score":0.96,"keypoints":16}
2021-05-29 18:30:45 DATA:  test-node-gpu.js result: performance: load: 348 total: 1028 2021-05-30 18:44:58 DATA:  test-node-gpu.js result: performance: load: 337 total: 1060
2021-05-29 18:30:46 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:44:59 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:46 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg movenet 2021-05-30 18:44:59 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg movenet
2021-05-29 18:30:46 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.7261000871658325,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:44:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:46 DATA:  test-node-gpu.js result: performance: load: 348 total: 327 2021-05-30 18:44:59 DATA:  test-node-gpu.js result: performance: load: 337 total: 321
2021-05-29 18:30:47 STATE: test-node-gpu.js passed: detect: random default 2021-05-30 18:45:00 STATE: test-node-gpu.js passed: detect: random default
2021-05-29 18:30:47 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} 2021-05-30 18:45:00 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-05-29 18:30:47 DATA:  test-node-gpu.js result: performance: load: 348 total: 757 2021-05-30 18:45:00 DATA:  test-node-gpu.js result: performance: load: 337 total: 182
2021-05-29 18:30:47 INFO:  test-node-gpu.js test: first instance 2021-05-30 18:45:00 INFO:  test-node-gpu.js test: first instance
2021-05-29 18:30:48 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] 2021-05-30 18:45:00 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-29 18:30:49 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default 2021-05-30 18:45:00 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default
2021-05-29 18:30:49 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":0.67,"keypoints":7} 2021-05-30 18:45:00 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.67,"keypoints":7}
2021-05-29 18:30:49 DATA:  test-node-gpu.js result: performance: load: 348 total: 1413 2021-05-30 18:45:00 DATA:  test-node-gpu.js result: performance: load: 337 total: 112
2021-05-29 18:30:49 INFO:  test-node-gpu.js test: second instance 2021-05-30 18:45:00 INFO:  test-node-gpu.js test: second instance
2021-05-29 18:30:50 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3] 2021-05-30 18:45:01 STATE: test-node-gpu.js passed: load image: assets/sample-me.jpg [1,700,700,3]
2021-05-29 18:30:51 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default 2021-05-30 18:45:02 STATE: test-node-gpu.js passed: detect: assets/sample-me.jpg default
2021-05-29 18:30:51 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.6820425987243652,"class":"person"} {"score":0.67,"keypoints":7} 2021-05-30 18:45:02 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 2 person: 1 {"confidence":1,"age":39.2,"gender":"male"} {"score":0.68,"class":"person"} {"score":0.67,"keypoints":7}
2021-05-29 18:30:51 DATA:  test-node-gpu.js result: performance: load: 2 total: 1429 2021-05-30 18:45:02 DATA:  test-node-gpu.js result: performance: load: 4 total: 1445
2021-05-29 18:30:51 INFO:  test-node-gpu.js test: concurrent 2021-05-30 18:45:02 INFO:  test-node-gpu.js test: concurrent
2021-05-29 18:30:51 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] 2021-05-30 18:45:02 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-29 18:30:51 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3] 2021-05-30 18:45:02 STATE: test-node-gpu.js passed: load image: assets/human-sample-face.jpg [1,256,256,3]
2021-05-29 18:30:52 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:45:03 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:53 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3] 2021-05-30 18:45:04 STATE: test-node-gpu.js passed: load image: assets/human-sample-body.jpg [1,1200,1200,3]
2021-05-29 18:30:59 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default 2021-05-30 18:45:09 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":0.73,"keypoints":17} 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: performance: load: 348 total: 5404 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: performance: load: 337 total: 5272
2021-05-29 18:30:59 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default 2021-05-30 18:45:09 STATE: test-node-gpu.js passed: detect: assets/human-sample-face.jpg default
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.8257162570953369,"class":"person"} {"score":0.73,"keypoints":17} 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"confidence":1,"age":23.6,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.73,"keypoints":17}
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: performance: load: 2 total: 5404 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: performance: load: 4 total: 5272
2021-05-29 18:30:59 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default 2021-05-30 18:45:09 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: performance: load: 348 total: 5404 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: performance: load: 337 total: 5272
2021-05-29 18:30:59 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default 2021-05-30 18:45:09 STATE: test-node-gpu.js passed: detect: assets/human-sample-body.jpg default
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.7273815870285034,"class":"person"} {"score":0.93,"keypoints":17} 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 3 object: 1 person: 1 {"confidence":1,"age":28.5,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.93,"keypoints":17}
2021-05-29 18:30:59 DATA:  test-node-gpu.js result: performance: load: 2 total: 5404 2021-05-30 18:45:09 DATA:  test-node-gpu.js result: performance: load: 4 total: 5272
2021-05-29 18:30:59 INFO:  test-node-gpu.js test complete: 19062 ms 2021-05-30 18:45:09 INFO:  test-node-gpu.js test complete: 17008 ms
2021-05-29 18:30:59 INFO:  test-node-wasm.js start 2021-05-30 18:45:09 INFO:  test-node-wasm.js start
2021-05-29 18:30:59 ERROR: test-node-wasm.js failed: model server: request to http://localhost:10030/models/ failed, reason: connect ECONNREFUSED 127.0.0.1:10030 2021-05-30 18:45:10 ERROR: test-node-wasm.js failed: model server: request to http://localhost:10030/models/ failed, reason: connect ECONNREFUSED 127.0.0.1:10030
2021-05-29 18:30:59 ERROR: test-node-wasm.js aborting test 2021-05-30 18:45:10 ERROR: test-node-wasm.js aborting test
2021-05-29 18:30:59 INFO:  status: {"passed":46,"failed":1} 2021-05-30 18:45:10 INFO:  status: {"passed":46,"failed":1}

View File

@ -74,6 +74,11 @@
<li>Results object definition: <a href="../interfaces/result.html">Result</a></li> <li>Results object definition: <a href="../interfaces/result.html">Result</a></li>
<li>Possible inputs: <a href="../index.html#input">Input</a></li> <li>Possible inputs: <a href="../index.html#input">Input</a></li>
</ul> </ul>
<dl class="tsd-comment-tags">
<dt>param</dt>
<dd><p><a href="../interfaces/config.html">Config</a></p>
</dd>
</dl>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-hierarchy"> <section class="tsd-panel tsd-hierarchy">
@ -141,9 +146,6 @@
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <div class="lead">
<p>Creates instance of Human library that is futher used for all operations</p> <p>Creates instance of Human library that is futher used for all operations</p>
<ul>
<li>@param userConfig: <a href="../interfaces/config.html">Config</a></li>
</ul>
</div> </div>
</div> </div>
<h4 class="tsd-parameters-title">Parameters</h4> <h4 class="tsd-parameters-title">Parameters</h4>
@ -166,9 +168,11 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <dl class="tsd-comment-tags">
<p>Internal: Currently loaded classes</p> <dt>internal:</dt>
</div> <dd><p>Currently loaded classes</p>
</dd>
</dl>
</div> </div>
<div class="tsd-type-declaration"> <div class="tsd-type-declaration">
<h4>Type declaration</h4> <h4>Type declaration</h4>
@ -430,9 +434,11 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <dl class="tsd-comment-tags">
<p>Internal: Instance of current image being processed</p> <dt>internal:</dt>
</div> <dd><p>Instance of current image being processed</p>
</dd>
</dl>
</div> </div>
<div class="tsd-type-declaration"> <div class="tsd-type-declaration">
<h4>Type declaration</h4> <h4>Type declaration</h4>
@ -453,9 +459,11 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <dl class="tsd-comment-tags">
<p>Internal: Currently loaded models</p> <dt>internal:</dt>
</div> <dd><p>Currently loaded models</p>
</dd>
</dl>
</div> </div>
<div class="tsd-type-declaration"> <div class="tsd-type-declaration">
<h4>Type declaration</h4> <h4>Type declaration</h4>
@ -577,12 +585,14 @@
<aside class="tsd-sources"> <aside class="tsd-sources">
</aside> </aside>
<div class="tsd-comment tsd-typography"> <div class="tsd-comment tsd-typography">
<div class="lead"> <dl class="tsd-comment-tags">
<p>Internal: Instance of TensorFlow/JS used by Human</p> <dt>internal:</dt>
<dd><p>Instance of TensorFlow/JS used by Human</p>
<ul> <ul>
<li>Can be embedded or externally provided</li> <li>Can be embedded or externally provided</li>
</ul> </ul>
</div> </dd>
</dl>
</div> </div>
</section> </section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
@ -631,6 +641,7 @@
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#error" class="tsd-signature-type" data-tsd-kind="Type alias">Error</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/result.html" class="tsd-signature-type" data-tsd-kind="Interface">Result</a><span class="tsd-signature-symbol">&gt;</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#error" class="tsd-signature-type" data-tsd-kind="Type alias">Error</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/result.html" class="tsd-signature-type" data-tsd-kind="Interface">Result</a><span class="tsd-signature-symbol">&gt;</span></h4>
<p>result: Result</p>
</li> </li>
</ul> </ul>
</section> </section>
@ -653,9 +664,6 @@
<ul class="tsd-parameters"> <ul class="tsd-parameters">
<li> <li>
<h5>input: <span class="tsd-signature-type">Tensor</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</span><span class="tsd-signature-symbol">&gt;</span></h5> <h5>input: <span class="tsd-signature-type">Tensor</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</span><span class="tsd-signature-symbol">&gt;</span></h5>
<div class="tsd-comment tsd-typography">
<p>Tensor as provided in human.result.face[n].tensor</p>
</div>
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Tensor</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</span><span class="tsd-signature-symbol">&gt;</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Tensor</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Rank</span><span class="tsd-signature-symbol">&gt;</span></h4>
@ -765,6 +773,7 @@
</li> </li>
</ul> </ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
<p>similarity: number</p>
</li> </li>
</ul> </ul>
</section> </section>

1
types/config.d.ts vendored
View File

@ -2,6 +2,7 @@
* Configuration interface definition for **Human** library * Configuration interface definition for **Human** library
* *
* Contains all configurable parameters * Contains all configurable parameters
* @typedef Config
*/ */
export interface Config { export interface Config {
/** Backend used for TFJS operations */ /** Backend used for TFJS operations */

33
types/human.d.ts vendored
View File

@ -18,9 +18,13 @@ import { Tensor } from './tfjs/types';
export type { Config } from './config'; export type { Config } from './config';
export type { Result, Face, Hand, Body, Item, Gesture } from './result'; export type { Result, Face, Hand, Body, Item, Gesture } from './result';
export type { DrawOptions } from './draw/draw'; export type { DrawOptions } from './draw/draw';
/** Defines all possible input types for **Human** detection */ /** Defines all possible input types for **Human** detection
* @typedef Input
*/
export declare type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas; export declare type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;
/** Error message */ /** Error message
* @typedef Error
*/
export declare type Error = { export declare type Error = {
error: string; error: string;
}; };
@ -36,6 +40,8 @@ declare type Model = unknown;
* - Configuration object definition: {@link Config} * - Configuration object definition: {@link Config}
* - Results object definition: {@link Result} * - Results object definition: {@link Result}
* - Possible inputs: {@link Input} * - Possible inputs: {@link Input}
*
* @param userConfig: {@link Config}
*/ */
export declare class Human { export declare class Human {
#private; #private;
@ -53,12 +59,12 @@ export declare class Human {
* - Can be polled to determine operations that are currently executed * - Can be polled to determine operations that are currently executed
*/ */
state: string; state: string;
/** Internal: Instance of current image being processed */ /** @internal: Instance of current image being processed */
image: { image: {
tensor: Tensor | null; tensor: Tensor | null;
canvas: OffscreenCanvas | HTMLCanvasElement | null; canvas: OffscreenCanvas | HTMLCanvasElement | null;
}; };
/** Internal: Instance of TensorFlow/JS used by Human /** @internal: Instance of TensorFlow/JS used by Human
* - Can be embedded or externally provided * - Can be embedded or externally provided
*/ */
tf: TensorFlow; tf: TensorFlow;
@ -79,7 +85,7 @@ export declare class Human {
canvas: typeof draw.canvas; canvas: typeof draw.canvas;
all: typeof draw.all; all: typeof draw.all;
}; };
/** Internal: Currently loaded models */ /** @internal: Currently loaded models */
models: { models: {
face: [Model, Model, Model] | null; face: [Model, Model, Model] | null;
posenet: Model | null; posenet: Model | null;
@ -96,7 +102,7 @@ export declare class Human {
centernet: Model | null; centernet: Model | null;
faceres: Model | null; faceres: Model | null;
}; };
/** Internal: Currently loaded classes */ /** @internal: Currently loaded classes */
classes: { classes: {
facemesh: typeof facemesh; facemesh: typeof facemesh;
emotion: typeof emotion; emotion: typeof emotion;
@ -119,22 +125,24 @@ export declare class Human {
perf: Record<string, unknown>; perf: Record<string, unknown>;
/** /**
* Creates instance of Human library that is futher used for all operations * Creates instance of Human library that is futher used for all operations
* - @param userConfig: {@link Config} * @param userConfig: {@link Config}
*/ */
constructor(userConfig?: Config | Record<string, unknown>); constructor(userConfig?: Config | Record<string, unknown>);
/** @hidden */ /** @hidden */
analyze: (...msg: any[]) => void; analyze: (...msg: any[]) => void;
/** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings) /** Simmilarity method calculates simmilarity between two provided face descriptors (face embeddings)
* - Calculation is based on normalized Minkowski distance between * - Calculation is based on normalized Minkowski distance between
* @param embedding1: face descriptor as array of numbers
* @param embedding2: face descriptor as array of numbers
* @returns similarity: number
*/ */
similarity(embedding1: Array<number>, embedding2: Array<number>): number; similarity(embedding1: Array<number>, embedding2: Array<number>): number;
/** Enhance method performs additional enhacements to face image previously detected for futher processing /** Enhance method performs additional enhacements to face image previously detected for futher processing
* @param input Tensor as provided in human.result.face[n].tensor * @param input: Tensor as provided in human.result.face[n].tensor
* @returns Tensor * @returns Tensor
*/ */
enhance(input: Tensor): Tensor | null; enhance(input: Tensor): Tensor | null;
/** /** Math method find best match between provided face descriptor and predefined database of known descriptors
* Math method find best match between provided face descriptor and predefined database of known descriptors
* @param faceEmbedding: face descriptor previsouly calculated on any face * @param faceEmbedding: face descriptor previsouly calculated on any face
* @param db: array of mapping of face descriptors to known values * @param db: array of mapping of face descriptors to known values
* @param threshold: minimum score for matching to be considered in the result * @param threshold: minimum score for matching to be considered in the result
@ -152,6 +160,7 @@ export declare class Human {
}; };
/** Load method preloads all configured models on-demand /** Load method preloads all configured models on-demand
* - Not explicitly required as any required model is load implicitly on it's first run * - Not explicitly required as any required model is load implicitly on it's first run
* @param userConfig: {@link Config}
*/ */
load(userConfig?: Config | Record<string, unknown>): Promise<void>; load(userConfig?: Config | Record<string, unknown>): Promise<void>;
/** Main detection method /** Main detection method
@ -159,11 +168,15 @@ export declare class Human {
* - Pre-process input: {@link Input} * - Pre-process input: {@link Input}
* - Run inference for all configured models * - Run inference for all configured models
* - Process and return result: {@link Result} * - Process and return result: {@link Result}
* @param input: Input
* @param userConfig: Config
* @returns result: Result
*/ */
detect(input: Input, userConfig?: Config | Record<string, unknown>): Promise<Result | Error>; detect(input: Input, userConfig?: Config | Record<string, unknown>): Promise<Result | Error>;
/** Warmup metho pre-initializes all models for faster inference /** Warmup metho pre-initializes all models for faster inference
* - can take significant time on startup * - can take significant time on startup
* - only used for `webgl` and `humangl` backends * - only used for `webgl` and `humangl` backends
* @param userConfig: Config
*/ */
warmup(userConfig?: Config | Record<string, unknown>): Promise<Result | { warmup(userConfig?: Config | Record<string, unknown>): Promise<Result | {
error: any; error: any;

2
types/result.d.ts vendored
View File

@ -1,5 +1,5 @@
/** /**
* Type definitions for Human results * Type definitions for Human result object
*/ */
import { Tensor } from '../dist/tfjs.esm.js'; import { Tensor } from '../dist/tfjs.esm.js';
/** Face results /** Face results