release candidate

pull/356/head
Vladimir Mandic 2021-09-12 00:30:11 -04:00
parent b8d594e18d
commit 83b705818d
4 changed files with 23 additions and 12 deletions

View File

@ -9,8 +9,9 @@
## Changelog
### **HEAD -> main** 2021/09/11 mandic00@live.com
### **HEAD -> main** 2021/09/12 mandic00@live.com
- mark all config items as optional
- redefine config and result interfaces
- fix usge of string enums
- start using partial definitions

View File

@ -1,6 +1,6 @@
{
"name": "@vladmandic/human",
"version": "2.1.5",
"version": "2.2.0",
"description": "Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition",
"sideEffects": false,
"main": "dist/human.node.js",

View File

@ -1,13 +1,6 @@
/* eslint-disable indent */
/* eslint-disable no-multi-spaces */
/**
* Configuration interface definition for **Human** library
*
* Contains all configurable parameters
* @typedef Config
*/
export interface FaceDetectorConfig {
modelPath: string,
rotation: boolean,
@ -185,6 +178,12 @@ export interface GestureConfig {
enabled: boolean,
}
/**
* Configuration interface definition for **Human** library
*
* Contains all configurable parameters
* @typedef Config
*/
export interface Config {
/** Backend used for TFJS operations */
// backend: '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu' | null,
@ -242,8 +241,12 @@ export interface Config {
segmentation: Partial<SegmentationConfig>,
}
/**
* [Default values](https://github.com/vladmandic/human/blob/main/src/config.ts#L244) for {@Config}
*
*/
const config: Config = {
backend: 'webgl', // select tfjs backend to use, leave empty to use default backend
backend: 'humangl', // 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
modelBasePath: '../models/', // base path for all models
wasmPath: '', // path for wasm binaries, only used for backend: wasm

View File

@ -32,7 +32,6 @@ import { Tensor, GraphModel } from './tfjs/types';
// export types
export * from './config';
export * from './result';
export type { DrawOptions } from './draw/draw';
/** Defines all possible input types for **Human** detection
@ -40,6 +39,15 @@ export type { DrawOptions } from './draw/draw';
*/
export type Input = Tensor | typeof Image | ImageData | ImageBitmap | HTMLImageElement | HTMLMediaElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;
/** Events dispatched by `human.events`
* - `create`: triggered when Human object is instantiated
* - `load`: triggered when models are loaded (explicitly or on-demand)
* - `image`: triggered when input image is this.processed
* - `result`: triggered when detection is complete
* - `warmup`: triggered when warmup is complete
*/
export type Events = 'create' | 'load' | 'image' | 'result' | 'warmup';
/** Error message
* @typedef Error Type
*/
@ -128,7 +136,6 @@ export class Human {
* - `result`: triggered when detection is complete
* - `warmup`: triggered when warmup is complete
*/
events: EventTarget;
/** Reference face triangualtion array of 468 points, used for triangle references between points */
faceTriangulation: typeof facemesh.triangulation;