updated gesture types

pull/193/head
Vladimir Mandic 2021-07-29 11:01:50 -04:00
parent 41b340b897
commit d20c5500d7
19 changed files with 241 additions and 188 deletions

View File

@ -26,6 +26,7 @@
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-var-requires": "off",
"camelcase": "off",
"dot-notation": "off",
@ -44,6 +45,7 @@
"no-bitwise": "off",
"no-case-declarations":"off",
"no-continue": "off",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-mixed-operators": "off",
"no-param-reassign":"off",
@ -52,12 +54,12 @@
"no-restricted-globals": "off",
"no-restricted-syntax": "off",
"no-return-assign": "off",
"no-shadow": "off",
"no-underscore-dangle": "off",
"node/no-missing-import": ["error", { "tryExtensions": [".js", ".json", ".ts"] }],
"node/no-unpublished-import": "off",
"node/no-unpublished-require": "off",
"node/no-unsupported-features/es-syntax": "off",
"no-lonely-if": "off",
"node/shebang": "off",
"object-curly-newline": "off",
"prefer-destructuring": "off",

View File

@ -9,7 +9,10 @@ Repository: **<git+https://github.com/vladmandic/human.git>**
## Changelog
### **HEAD -> main** 2021/07/19 marcogodoy@untitled.cl
### **HEAD -> main** 2021/07/29 mandic00@live.com
### **origin/main** 2021/07/19 marcogodoy@untitled.cl
- add note on manually disping tensor
- modularize model loading

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

@ -9928,8 +9928,9 @@ var hand = (res) => {
}
if (fingers && fingers.length > 0) {
const closest = fingers.reduce((best, a) => best.position[2] < a.position[2] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward` });
const highest = fingers.reduce((best, a) => best.position[1] < a.position[1] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });
gestures.push({ hand: i, gesture: `${highest.name} up` });
}
}
return gestures;

View File

@ -9929,8 +9929,9 @@ var hand = (res) => {
}
if (fingers && fingers.length > 0) {
const closest = fingers.reduce((best, a) => best.position[2] < a.position[2] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward` });
const highest = fingers.reduce((best, a) => best.position[1] < a.position[1] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });
gestures.push({ hand: i, gesture: `${highest.name} up` });
}
}
return gestures;

3
dist/human.node.js vendored
View File

@ -9928,8 +9928,9 @@ var hand = (res) => {
}
if (fingers && fingers.length > 0) {
const closest = fingers.reduce((best, a) => best.position[2] < a.position[2] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward` });
const highest = fingers.reduce((best, a) => best.position[1] < a.position[1] ? best : a);
gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });
gestures.push({ hand: i, gesture: `${highest.name} up` });
}
}
return gestures;

View File

@ -230,18 +230,18 @@ async function build(f, msg, dev = false) {
log.state(` target: ${targetGroupName} type: ${targetName}:`, stats);
}
}
if (!dev) { // only for prod builds, skipped for dev build
await lint.run(config.lintLocations); // run linter
await changelog.update(config.changelog); // generate changelog
await typings.run(targets.browserBundle.esm.entryPoints); // generate typings
await typedoc.run(targets.browserBundle.esm.entryPoints); // generate typedoc
}
if (require.main === module) process.exit(0);
} catch (err) {
// catch errors and print where it occured
log.error('Build error', JSON.stringify(err.errors || err, null, 2));
if (require.main === module) process.exit(1);
}
if (!dev) { // only for prod builds, skipped for dev build
await lint.run(config.lintLocations); // run linter
await changelog.update(config.changelog); // generate changelog
await typings.run(targets.browserBundle.esm.entryPoints); // generate typings
await typedoc.run(targets.browserBundle.esm.entryPoints); // generate typedoc
}
if (require.main === module) process.exit(0);
busy = false;
}

View File

@ -1,22 +1,22 @@
2021-07-29 09:50:22 INFO:  @vladmandic/human version 2.0.3
2021-07-29 09:50:22 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-07-29 09:50:22 INFO:  Toolchain: {"tfjs":"3.8.0","esbuild":"0.12.16","typescript":"4.3.5","typedoc":"0.21.4","eslint":"7.31.0"}
2021-07-29 09:50:22 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-07-29 09:50:22 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-07-29 09:50:22 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 09:50:22 STATE: target: node type: node: {"imports":42,"importBytes":433163,"outputBytes":377194,"outputFiles":"dist/human.node.js"}
2021-07-29 09:50:22 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 09:50:22 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":433171,"outputBytes":377198,"outputFiles":"dist/human.node-gpu.js"}
2021-07-29 09:50:22 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 09:50:22 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":433238,"outputBytes":377270,"outputFiles":"dist/human.node-wasm.js"}
2021-07-29 09:50:22 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2817,"outputBytes":1214,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 09:50:22 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":433074,"outputBytes":247654,"outputFiles":"dist/human.esm-nobundle.js"}
2021-07-29 09:50:23 STATE: target: browserBundle type: tfjs: {"modules":1552,"moduleBytes":5630928,"imports":7,"importBytes":2817,"outputBytes":2817976,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 09:50:23 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":3249836,"outputBytes":1599126,"outputFiles":"dist/human.js"}
2021-07-29 09:50:24 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":3249836,"outputBytes":1599118,"outputFiles":"dist/human.esm.js"}
2021-07-29 09:50:24 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-07-29 09:50:49 INFO:  Linter complete: files: 74 errors: 0 warnings: 0
2021-07-29 09:50:49 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-07-29 09:50:49 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-07-29 09:51:04 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-07-29 09:51:19 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1
2021-07-29 10:49:34 INFO:  @vladmandic/human version 2.0.3
2021-07-29 10:49:34 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-07-29 10:49:34 INFO:  Toolchain: {"tfjs":"3.8.0","esbuild":"0.12.16","typescript":"4.3.5","typedoc":"0.21.4","eslint":"7.31.0"}
2021-07-29 10:49:34 INFO:  Clean: ["dist/*","types/*","typedoc/*"]
2021-07-29 10:49:34 INFO:  Build: file startup all type: production config: {"minifyWhitespace":true,"minifyIdentifiers":true,"minifySyntax":true}
2021-07-29 10:49:34 STATE: target: node type: tfjs: {"imports":1,"importBytes":102,"outputBytes":1303,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 10:49:34 STATE: target: node type: node: {"imports":42,"importBytes":433972,"outputBytes":377240,"outputFiles":"dist/human.node.js"}
2021-07-29 10:49:34 STATE: target: nodeGPU type: tfjs: {"imports":1,"importBytes":110,"outputBytes":1311,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 10:49:34 STATE: target: nodeGPU type: node: {"imports":42,"importBytes":433980,"outputBytes":377244,"outputFiles":"dist/human.node-gpu.js"}
2021-07-29 10:49:34 STATE: target: nodeWASM type: tfjs: {"imports":1,"importBytes":149,"outputBytes":1378,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 10:49:34 STATE: target: nodeWASM type: node: {"imports":42,"importBytes":434047,"outputBytes":377316,"outputFiles":"dist/human.node-wasm.js"}
2021-07-29 10:49:34 STATE: target: browserNoBundle type: tfjs: {"imports":1,"importBytes":2817,"outputBytes":1214,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 10:49:34 STATE: target: browserNoBundle type: esm: {"imports":42,"importBytes":433883,"outputBytes":247685,"outputFiles":"dist/human.esm-nobundle.js"}
2021-07-29 10:49:35 STATE: target: browserBundle type: tfjs: {"modules":1552,"moduleBytes":5630928,"imports":7,"importBytes":2817,"outputBytes":2817976,"outputFiles":"dist/tfjs.esm.js"}
2021-07-29 10:49:35 STATE: target: browserBundle type: iife: {"imports":42,"importBytes":3250645,"outputBytes":1599157,"outputFiles":"dist/human.js"}
2021-07-29 10:49:36 STATE: target: browserBundle type: esm: {"imports":42,"importBytes":3250645,"outputBytes":1599149,"outputFiles":"dist/human.esm.js"}
2021-07-29 10:49:36 INFO:  Running Linter: ["server/","src/","tfjs/","test/","demo/"]
2021-07-29 10:50:01 INFO:  Linter complete: files: 74 errors: 0 warnings: 0
2021-07-29 10:50:01 INFO:  Generate ChangeLog: ["/home/vlado/dev/human/CHANGELOG.md"]
2021-07-29 10:50:01 INFO:  Generate Typings: ["src/human.ts"] outDir: ["types"]
2021-07-29 10:50:17 INFO:  Generate TypeDocs: ["src/human.ts"] outDir: ["typedoc"]
2021-07-29 10:50:31 INFO:  Documentation generated at /home/vlado/dev/human/typedoc 1

View File

@ -4,9 +4,41 @@
import { Gesture } from '../result';
/**
* @typedef FaceGesture
*/
export type FaceGesture =
`facing ${'left' | 'center' | 'right'}`
| `blink ${'left' | 'right'} eye`
| `mouth ${number}% open`
| `head ${'up' | 'down'}`;
/**
* @typedef IrisGesture
*/
export type IrisGesture =
'facing center'
| `looking ${'left' | 'right' | 'up' | 'down'}`
| 'looking center';
/**
* @typedef BodyGesture
*/
export type BodyGesture =
`leaning ${'left' | 'right'}`
| `raise ${'left' | 'right'} hand`
| 'i give up';
/**
* @typedef BodyGesture
*/
export type HandGesture =
`${'thumb' | 'index finger' | 'middle finger' | 'ring finger' | 'pinky'} forward`
| `${'thumb' | 'index finger' | 'middle finger' | 'ring finger' | 'pinky'} up`;
export const body = (res): Gesture[] => {
if (!res) return [];
const gestures: Array<{ body: number, gesture: string }> = [];
const gestures: Array<{ body: number, gesture: BodyGesture }> = [];
for (let i = 0; i < res.length; i++) {
// raising hands
const leftWrist = res[i].keypoints.find((a) => (a.part === 'leftWrist'));
@ -26,7 +58,7 @@ export const body = (res): Gesture[] => {
export const face = (res): Gesture[] => {
if (!res) return [];
const gestures: Array<{ face: number, gesture: string }> = [];
const gestures: Array<{ face: number, gesture: FaceGesture }> = [];
for (let i = 0; i < res.length; i++) {
if (res[i].mesh && res[i].mesh.length > 0) {
const eyeFacing = res[i].mesh[33][2] - res[i].mesh[263][2];
@ -47,7 +79,7 @@ export const face = (res): Gesture[] => {
export const iris = (res): Gesture[] => {
if (!res) return [];
const gestures: Array<{ iris: number, gesture: string }> = [];
const gestures: Array<{ iris: number, gesture: IrisGesture }> = [];
for (let i = 0; i < res.length; i++) {
if (!res[i].annotations || !res[i].annotations.leftEyeIris || !res[i].annotations.rightEyeIris) continue;
const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0];
@ -85,7 +117,7 @@ export const iris = (res): Gesture[] => {
export const hand = (res): Gesture[] => {
if (!res) return [];
const gestures: Array<{ hand: number, gesture: string }> = [];
const gestures: Array<{ hand: number, gesture: HandGesture }> = [];
for (let i = 0; i < res.length; i++) {
const fingers: Array<{ name: string, position: number }> = [];
for (const [finger, pos] of Object.entries(res[i]['annotations'])) {
@ -93,8 +125,9 @@ export const hand = (res): Gesture[] => {
}
if (fingers && fingers.length > 0) {
const closest = fingers.reduce((best, a) => (best.position[2] < a.position[2] ? best : a));
gestures.push({ hand: i, gesture: `${closest.name} forward` as HandGesture });
const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));
gestures.push({ hand: i, gesture: `${closest.name} forward ${highest.name} up` });
gestures.push({ hand: i, gesture: `${highest.name} up` as HandGesture });
}
}
return gestures;

View File

@ -3,6 +3,7 @@
*/
import { Tensor } from './tfjs/types';
import { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';
/** Face results
* Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models
@ -132,10 +133,10 @@ export interface Item {
* - gesture: gesture detected
*/
export type Gesture =
{ 'face': number, gesture: string }
| { 'iris': number, gesture: string }
| { 'body': number, gesture: string }
| { 'hand': number, gesture: string }
{ 'face': number, gesture: FaceGesture }
| { 'iris': number, gesture: IrisGesture }
| { 'body': number, gesture: BodyGesture }
| { 'hand': number, gesture: HandGesture }
/** Person getter
* @interface Person Interface

View File

@ -10,13 +10,7 @@ Not required for normal funcioning of library
- Face rotation is disabled for `NodeJS` platform:
`Kernel 'RotateWithOffset' not registered for backend 'tensorflow'`
<https://github.com/tensorflow/tfjs/issues/4606>
### NodeJS with GPU acceleation using CUDA
- Image filters are disabled due to lack of Canvas and WeBGL access
- Face rotation is disabled for `NodeJS` platform:
`Kernel 'RotateWithOffset' not registered for backend 'tensorflow'`
<https://github.com/tensorflow/tfjs/issues/4606>
Work has recently been completed and will likely be included in TFJS 3.9.0
### NodeJS using WASM

View File

@ -1,120 +1,120 @@
2021-07-29 09:52:09 INFO:  @vladmandic/human version 2.0.3
2021-07-29 09:52:09 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-07-29 09:52:09 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-07-29 09:52:09 INFO:  test-node.js start
2021-07-29 09:52:11 STATE: test-node.js passed: create human
2021-07-29 09:52:11 INFO:  test-node.js human version: 2.0.3
2021-07-29 09:52:11 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.5.0
2021-07-29 09:52:11 INFO:  test-node.js tfjs version: 3.8.0
2021-07-29 09:52:11 STATE: test-node.js passed: set backend: tensorflow
2021-07-29 09:52:11 STATE: test-node.js passed: load models
2021-07-29 09:52:11 STATE: test-node.js result: defined models: 14 loaded models: 7
2021-07-29 09:52:11 STATE: test-node.js passed: warmup: none default
2021-07-29 09:52:13 STATE: test-node.js passed: warmup: face default
2021-07-29 09:52:13 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-07-29 09:52:13 DATA:  test-node.js result: performance: load: 388 total: 1330
2021-07-29 09:52:14 STATE: test-node.js passed: warmup: body default
2021-07-29 09:52:14 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-07-29 09:52:14 DATA:  test-node.js result: performance: load: 388 total: 1068
2021-07-29 09:52:14 INFO:  test-node.js test body variants
2021-07-29 09:52:15 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:15 STATE: test-node.js passed: detect: samples/ai-body.jpg posenet
2021-07-29 09:52:15 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-07-29 09:52:15 DATA:  test-node.js result: performance: load: 388 total: 749
2021-07-29 09:52:16 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:16 STATE: test-node.js passed: detect: samples/ai-body.jpg movenet
2021-07-29 09:52:16 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-07-29 09:52:16 DATA:  test-node.js result: performance: load: 388 total: 202
2021-07-29 09:52:17 STATE: test-node.js passed: detect: random default
2021-07-29 09:52:17 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0}
2021-07-29 09:52:17 DATA:  test-node.js result: performance: load: 388 total: 597
2021-07-29 09:52:17 INFO:  test-node.js test: first instance
2021-07-29 09:52:17 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 09:52:18 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-07-29 09:52:18 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-07-29 09:52:18 DATA:  test-node.js result: performance: load: 388 total: 963
2021-07-29 09:52:18 INFO:  test-node.js test: second instance
2021-07-29 09:52:19 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 09:52:20 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-07-29 09:52:20 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-07-29 09:52:20 DATA:  test-node.js result: performance: load: 3 total: 885
2021-07-29 09:52:20 INFO:  test-node.js test: concurrent
2021-07-29 09:52:20 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 09:52:20 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 09:52:20 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:21 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:25 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-07-29 09:52:25 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-07-29 09:52:25 DATA:  test-node.js result: performance: load: 388 total: 3664
2021-07-29 09:52:25 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-07-29 09:52:25 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-07-29 09:52:25 DATA:  test-node.js result: performance: load: 3 total: 3664
2021-07-29 09:52:25 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-07-29 09:52:25 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-07-29 09:52:25 DATA:  test-node.js result: performance: load: 388 total: 3664
2021-07-29 09:52:25 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-07-29 09:52:25 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-07-29 09:52:25 DATA:  test-node.js result: performance: load: 3 total: 3664
2021-07-29 09:52:25 INFO:  test-node.js test complete: 14189 ms
2021-07-29 09:52:25 INFO:  test-node-gpu.js start
2021-07-29 09:52:26 WARN:  test-node-gpu.js stderr: 2021-07-29 09:52:26.549997: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] 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-07-29 09:52:26 WARN:  test-node-gpu.js stderr: 2021-07-29 09:52:26.826057: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-07-29 09:52:26 WARN:  test-node-gpu.js stderr: 2021-07-29 09:52:26.826113: 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-07-29 09:52:26 STATE: test-node-gpu.js passed: create human
2021-07-29 09:52:26 INFO:  test-node-gpu.js human version: 2.0.3
2021-07-29 09:52:26 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.5.0
2021-07-29 09:52:26 INFO:  test-node-gpu.js tfjs version: 3.8.0
2021-07-29 09:52:27 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-07-29 09:52:27 STATE: test-node-gpu.js passed: load models
2021-07-29 09:52:27 STATE: test-node-gpu.js result: defined models: 14 loaded models: 7
2021-07-29 09:52:27 STATE: test-node-gpu.js passed: warmup: none default
2021-07-29 09:52:28 STATE: test-node-gpu.js passed: warmup: face default
2021-07-29 09:52:28 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-07-29 09:52:28 DATA:  test-node-gpu.js result: performance: load: 281 total: 1350
2021-07-29 09:52:29 STATE: test-node-gpu.js passed: warmup: body default
2021-07-29 09:52:29 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-07-29 09:52:29 DATA:  test-node-gpu.js result: performance: load: 281 total: 1051
2021-07-29 09:52:29 INFO:  test-node-gpu.js test body variants
2021-07-29 09:52:30 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:31 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg posenet
2021-07-29 09:52:31 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-07-29 09:52:31 DATA:  test-node-gpu.js result: performance: load: 281 total: 732
2021-07-29 09:52:32 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:32 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg movenet
2021-07-29 09:52:32 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-07-29 09:52:32 DATA:  test-node-gpu.js result: performance: load: 281 total: 176
2021-07-29 09:52:33 STATE: test-node-gpu.js passed: detect: random default
2021-07-29 09:52:33 DATA:  test-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0}
2021-07-29 09:52:33 DATA:  test-node-gpu.js result: performance: load: 281 total: 595
2021-07-29 09:52:33 INFO:  test-node-gpu.js test: first instance
2021-07-29 09:52:33 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 09:52:34 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-07-29 09:52:34 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-07-29 09:52:34 DATA:  test-node-gpu.js result: performance: load: 281 total: 940
2021-07-29 09:52:34 INFO:  test-node-gpu.js test: second instance
2021-07-29 09:52:34 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 09:52:35 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-07-29 09:52:35 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-07-29 09:52:35 DATA:  test-node-gpu.js result: performance: load: 3 total: 996
2021-07-29 09:52:35 INFO:  test-node-gpu.js test: concurrent
2021-07-29 09:52:35 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 09:52:35 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 09:52:36 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:37 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 09:52:41 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-07-29 09:52:41 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-07-29 09:52:41 DATA:  test-node-gpu.js result: performance: load: 281 total: 3763
2021-07-29 09:52:41 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-07-29 09:52:41 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-07-29 09:52:41 DATA:  test-node-gpu.js result: performance: load: 3 total: 3763
2021-07-29 09:52:41 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-07-29 09:52:41 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-07-29 09:52:41 DATA:  test-node-gpu.js result: performance: load: 281 total: 3763
2021-07-29 09:52:41 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-07-29 09:52:41 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-07-29 09:52:41 DATA:  test-node-gpu.js result: performance: load: 3 total: 3763
2021-07-29 09:52:41 INFO:  test-node-gpu.js test complete: 14149 ms
2021-07-29 09:52:41 INFO:  test-node-wasm.js start
2021-07-29 09:52:41 ERROR: test-node-wasm.js failed: model server: request to http://localhost:10030/models/ failed, reason: connect ECONNREFUSED 127.0.0.1:10030
2021-07-29 09:52:41 ERROR: test-node-wasm.js aborting test
2021-07-29 09:52:41 INFO:  status: {"passed":46,"failed":1}
2021-07-29 10:01:36 INFO:  @vladmandic/human version 2.0.3
2021-07-29 10:01:36 INFO:  User: vlado Platform: linux Arch: x64 Node: v16.5.0
2021-07-29 10:01:36 INFO:  tests: ["test-node.js","test-node-gpu.js","test-node-wasm.js"]
2021-07-29 10:01:36 INFO:  test-node.js start
2021-07-29 10:01:36 STATE: test-node.js passed: create human
2021-07-29 10:01:36 INFO:  test-node.js human version: 2.0.3
2021-07-29 10:01:36 INFO:  test-node.js platform: linux x64 agent: NodeJS v16.5.0
2021-07-29 10:01:36 INFO:  test-node.js tfjs version: 3.8.0
2021-07-29 10:01:36 STATE: test-node.js passed: set backend: tensorflow
2021-07-29 10:01:36 STATE: test-node.js passed: load models
2021-07-29 10:01:36 STATE: test-node.js result: defined models: 14 loaded models: 7
2021-07-29 10:01:36 STATE: test-node.js passed: warmup: none default
2021-07-29 10:01:38 STATE: test-node.js passed: warmup: face default
2021-07-29 10:01:38 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-07-29 10:01:38 DATA:  test-node.js result: performance: load: 381 total: 1321
2021-07-29 10:01:39 STATE: test-node.js passed: warmup: body default
2021-07-29 10:01:39 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-07-29 10:01:39 DATA:  test-node.js result: performance: load: 381 total: 1085
2021-07-29 10:01:39 INFO:  test-node.js test body variants
2021-07-29 10:01:40 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:40 STATE: test-node.js passed: detect: samples/ai-body.jpg posenet
2021-07-29 10:01:40 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-07-29 10:01:40 DATA:  test-node.js result: performance: load: 381 total: 690
2021-07-29 10:01:41 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:41 STATE: test-node.js passed: detect: samples/ai-body.jpg movenet
2021-07-29 10:01:41 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-07-29 10:01:41 DATA:  test-node.js result: performance: load: 381 total: 190
2021-07-29 10:01:42 STATE: test-node.js passed: detect: random default
2021-07-29 10:01:42 DATA:  test-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0}
2021-07-29 10:01:42 DATA:  test-node.js result: performance: load: 381 total: 595
2021-07-29 10:01:42 INFO:  test-node.js test: first instance
2021-07-29 10:01:42 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 10:01:43 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-07-29 10:01:43 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-07-29 10:01:43 DATA:  test-node.js result: performance: load: 381 total: 902
2021-07-29 10:01:43 INFO:  test-node.js test: second instance
2021-07-29 10:01:43 STATE: test-node.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 10:01:44 STATE: test-node.js passed: detect: samples/ai-upper.jpg default
2021-07-29 10:01: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.71,"class":"person"} {"score":0.78,"keypoints":7}
2021-07-29 10:01:44 DATA:  test-node.js result: performance: load: 3 total: 892
2021-07-29 10:01:44 INFO:  test-node.js test: concurrent
2021-07-29 10:01:44 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 10:01:44 STATE: test-node.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 10:01:45 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:46 STATE: test-node.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:50 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-07-29 10:01:50 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-07-29 10:01:50 DATA:  test-node.js result: performance: load: 381 total: 3806
2021-07-29 10:01:50 STATE: test-node.js passed: detect: samples/ai-face.jpg default
2021-07-29 10:01:50 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-07-29 10:01:50 DATA:  test-node.js result: performance: load: 3 total: 3806
2021-07-29 10:01:50 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-07-29 10:01:50 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-07-29 10:01:50 DATA:  test-node.js result: performance: load: 381 total: 3806
2021-07-29 10:01:50 STATE: test-node.js passed: detect: samples/ai-body.jpg default
2021-07-29 10:01:50 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-07-29 10:01:50 DATA:  test-node.js result: performance: load: 3 total: 3806
2021-07-29 10:01:50 INFO:  test-node.js test complete: 13727 ms
2021-07-29 10:01:50 INFO:  test-node-gpu.js start
2021-07-29 10:01:50 WARN:  test-node-gpu.js stderr: 2021-07-29 10:01:50.676793: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] 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-07-29 10:01:50 WARN:  test-node-gpu.js stderr: 2021-07-29 10:01:50.723534: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-07-29 10:01:50 WARN:  test-node-gpu.js stderr: 2021-07-29 10:01:50.723659: 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-07-29 10:01:50 STATE: test-node-gpu.js passed: create human
2021-07-29 10:01:50 INFO:  test-node-gpu.js human version: 2.0.3
2021-07-29 10:01:50 INFO:  test-node-gpu.js platform: linux x64 agent: NodeJS v16.5.0
2021-07-29 10:01:50 INFO:  test-node-gpu.js tfjs version: 3.8.0
2021-07-29 10:01:51 STATE: test-node-gpu.js passed: set backend: tensorflow
2021-07-29 10:01:51 STATE: test-node-gpu.js passed: load models
2021-07-29 10:01:51 STATE: test-node-gpu.js result: defined models: 14 loaded models: 7
2021-07-29 10:01:51 STATE: test-node-gpu.js passed: warmup: none default
2021-07-29 10:01:52 STATE: test-node-gpu.js passed: warmup: face default
2021-07-29 10:01:52 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-07-29 10:01:52 DATA:  test-node-gpu.js result: performance: load: 290 total: 1146
2021-07-29 10:01:53 STATE: test-node-gpu.js passed: warmup: body default
2021-07-29 10:01:53 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-07-29 10:01:53 DATA:  test-node-gpu.js result: performance: load: 290 total: 1090
2021-07-29 10:01:53 INFO:  test-node-gpu.js test body variants
2021-07-29 10:01:54 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:54 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg posenet
2021-07-29 10:01: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.96,"keypoints":16}
2021-07-29 10:01:54 DATA:  test-node-gpu.js result: performance: load: 290 total: 736
2021-07-29 10:01:55 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:55 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg movenet
2021-07-29 10:01:55 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-07-29 10:01:55 DATA:  test-node-gpu.js result: performance: load: 290 total: 202
2021-07-29 10:01:56 STATE: test-node-gpu.js passed: detect: random default
2021-07-29 10:01:56 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-07-29 10:01:56 DATA:  test-node-gpu.js result: performance: load: 290 total: 169
2021-07-29 10:01:56 INFO:  test-node-gpu.js test: first instance
2021-07-29 10:01:56 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 10:01:56 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-07-29 10:01:56 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-07-29 10:01:56 DATA:  test-node-gpu.js result: performance: load: 290 total: 123
2021-07-29 10:01:56 INFO:  test-node-gpu.js test: second instance
2021-07-29 10:01:57 STATE: test-node-gpu.js passed: load image: samples/ai-upper.jpg [1,720,688,3]
2021-07-29 10:01:57 STATE: test-node-gpu.js passed: detect: samples/ai-upper.jpg default
2021-07-29 10:01:57 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-07-29 10:01:57 DATA:  test-node-gpu.js result: performance: load: 2 total: 842
2021-07-29 10:01:57 INFO:  test-node-gpu.js test: concurrent
2021-07-29 10:01:57 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 10:01:57 STATE: test-node-gpu.js passed: load image: samples/ai-face.jpg [1,256,256,3]
2021-07-29 10:01:58 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:01:59 STATE: test-node-gpu.js passed: load image: samples/ai-body.jpg [1,1200,1200,3]
2021-07-29 10:02:03 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-07-29 10:02: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-07-29 10:02:03 DATA:  test-node-gpu.js result: performance: load: 290 total: 3784
2021-07-29 10:02:03 STATE: test-node-gpu.js passed: detect: samples/ai-face.jpg default
2021-07-29 10:02: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-07-29 10:02:03 DATA:  test-node-gpu.js result: performance: load: 2 total: 3784
2021-07-29 10:02:03 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-07-29 10:02: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-07-29 10:02:03 DATA:  test-node-gpu.js result: performance: load: 290 total: 3784
2021-07-29 10:02:03 STATE: test-node-gpu.js passed: detect: samples/ai-body.jpg default
2021-07-29 10:02: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-07-29 10:02:03 DATA:  test-node-gpu.js result: performance: load: 2 total: 3784
2021-07-29 10:02:03 INFO:  test-node-gpu.js test complete: 12649 ms
2021-07-29 10:02:03 INFO:  test-node-wasm.js start
2021-07-29 10:02:03 ERROR: test-node-wasm.js failed: model server: request to http://localhost:10030/models/ failed, reason: connect ECONNREFUSED 127.0.0.1:10030
2021-07-29 10:02:03 ERROR: test-node-wasm.js aborting test
2021-07-29 10:02:03 INFO:  status: {"passed":46,"failed":1}

View File

@ -129,7 +129,7 @@
<section class="tsd-panel tsd-member tsd-kind-type-alias">
<a name="Gesture" class="tsd-anchor"></a>
<h3>Gesture</h3>
<div class="tsd-signature tsd-kind-icon">Gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>hand<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<div class="tsd-signature tsd-kind-icon">Gesture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>face<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">FaceGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">IrisGesture</span><span class="tsd-signature-symbol">; </span>iris<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BodyGesture</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{ </span>gesture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HandGesture</span><span class="tsd-signature-symbol">; </span>hand<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
</aside>
<div class="tsd-comment tsd-typography">

View File

@ -2,6 +2,22 @@
* Gesture detection module
*/
import { Gesture } from '../result';
/**
* @typedef FaceGesture
*/
export declare type FaceGesture = `facing ${'left' | 'center' | 'right'}` | `blink ${'left' | 'right'} eye` | `mouth ${number}% open` | `head ${'up' | 'down'}`;
/**
* @typedef IrisGesture
*/
export declare type IrisGesture = 'facing center' | `looking ${'left' | 'right' | 'up' | 'down'}` | 'looking center';
/**
* @typedef BodyGesture
*/
export declare type BodyGesture = `leaning ${'left' | 'right'}` | `raise ${'left' | 'right'} hand` | 'i give up';
/**
* @typedef BodyGesture
*/
export declare type HandGesture = `${'thumb' | 'index finger' | 'middle finger' | 'ring finger' | 'pinky'} forward` | `${'thumb' | 'index finger' | 'middle finger' | 'ring finger' | 'pinky'} up`;
export declare const body: (res: any) => Gesture[];
export declare const face: (res: any) => Gesture[];
export declare const iris: (res: any) => Gesture[];

View File

@ -2,6 +2,7 @@
* Type definitions for Human result object
*/
import { Tensor } from './tfjs/types';
import { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';
/** Face results
* Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models
* Some values may be null if specific model is not enabled
@ -137,16 +138,16 @@ export interface Item {
*/
export declare type Gesture = {
'face': number;
gesture: string;
gesture: FaceGesture;
} | {
'iris': number;
gesture: string;
gesture: IrisGesture;
} | {
'body': number;
gesture: string;
gesture: BodyGesture;
} | {
'hand': number;
gesture: string;
gesture: HandGesture;
};
/** Person getter
* @interface Person Interface