human/dist/human.d.ts

897 lines
84 KiB
TypeScript
Raw Normal View History

2021-03-17 23:48:02 +01:00
declare module "log" {
export function log(...msg: any[]): void;
}
declare module "sysinfo" {
export function info(): {
platform: any;
agent: any;
};
}
declare module "tfjs/backend" {
export const config: {
name: string;
priority: number;
canvas: null;
gl: null;
width: number;
height: number;
webGLattr: {
alpha: boolean;
antialias: boolean;
premultipliedAlpha: boolean;
preserveDrawingBuffer: boolean;
depth: boolean;
stencil: boolean;
failIfMajorPerformanceCaveat: boolean;
desynchronized: boolean;
};
};
export function register(): void;
}
declare module "blazeface/blazeface" {
export const disposeBox: (box: any) => void;
export class BlazeFaceModel {
model: any;
anchorsData: any;
anchors: any;
inputSize: number;
config: any;
constructor(model: any, config: any);
getBoundingBoxes(inputImage: any): Promise<{
boxes: {
box: any;
landmarks: any;
anchor: any;
confidence: number;
}[];
scaleFactor: number[];
} | null>;
}
export function load(config: any): Promise<BlazeFaceModel>;
}
declare module "blazeface/box" {
export function scaleBoxCoordinates(box: any, factor: any): {
startPoint: number[];
endPoint: number[];
};
export function getBoxSize(box: any): number[];
export function getBoxCenter(box: any): any[];
export function cutBoxFromImageAndResize(box: any, image: any, cropSize: any): any;
export function enlargeBox(box: any, factor?: number): {
startPoint: number[];
endPoint: any[];
landmarks: any;
};
export function squarifyBox(box: any): {
startPoint: number[];
endPoint: any[];
landmarks: any;
};
}
declare module "blazeface/util" {
export const IDENTITY_MATRIX: number[][];
/**
* Normalizes the provided angle to the range -pi to pi.
* @param angle The angle in radians to be normalized.
*/
export function normalizeRadians(angle: any): number;
/**
* Computes the angle of rotation between two anchor points.
* @param point1 First anchor point
* @param point2 Second anchor point
*/
export function computeRotation(point1: any, point2: any): number;
export function radToDegrees(rad: any): number;
export function buildTranslationMatrix(x: any, y: any): any[][];
export function dot(v1: any, v2: any): number;
export function getColumnFrom2DArr(arr: any, columnIndex: any): number[];
export function multiplyTransformMatrices(mat1: any, mat2: any): number[][];
export function buildRotationMatrix(rotation: any, center: any): number[][];
export function invertTransformMatrix(matrix: any): any[][];
export function rotatePoint(homogeneousCoordinate: any, rotationMatrix: any): number[];
export function xyDistanceBetweenPoints(a: any, b: any): number;
}
declare module "blazeface/coords" {
export const MESH_ANNOTATIONS: {
silhouette: number[];
lipsUpperOuter: number[];
lipsLowerOuter: number[];
lipsUpperInner: number[];
lipsLowerInner: number[];
rightEyeUpper0: number[];
rightEyeLower0: number[];
rightEyeUpper1: number[];
rightEyeLower1: number[];
rightEyeUpper2: number[];
rightEyeLower2: number[];
rightEyeLower3: number[];
rightEyebrowUpper: number[];
rightEyebrowLower: number[];
rightEyeIris: number[];
leftEyeUpper0: number[];
leftEyeLower0: number[];
leftEyeUpper1: number[];
leftEyeLower1: number[];
leftEyeUpper2: number[];
leftEyeLower2: number[];
leftEyeLower3: number[];
leftEyebrowUpper: number[];
leftEyebrowLower: number[];
leftEyeIris: number[];
midwayBetweenEyes: number[];
noseTip: number[];
noseBottom: number[];
noseRightCorner: number[];
noseLeftCorner: number[];
rightCheek: number[];
leftCheek: number[];
};
export const MESH_TO_IRIS_INDICES_MAP: {
key: string;
indices: number[];
}[];
export const UV468: number[][];
export const TRI468: number[];
export const TRI68: number[];
export const TRI33: number[];
export const TRI7: number[];
export const VTX68: number[];
export const VTX33: number[];
export const VTX7: number[];
export const UV68: number[][];
export const UV33: number[][];
export const UV7: number[][];
}
declare module "blazeface/facepipeline" {
export class Pipeline {
storedBoxes: any;
boundingBoxDetector: any;
meshDetector: any;
irisModel: any;
boxSize: number;
meshSize: number;
irisSize: number;
irisEnlarge: number;
skipped: number;
detectedFaces: number;
constructor(boundingBoxDetector: any, meshDetector: any, irisModel: any);
transformRawCoords(rawCoords: any, box: any, angle: any, rotationMatrix: any): any;
getLeftToRightEyeDepthDifference(rawCoords: any): number;
getEyeBox(rawCoords: any, face: any, eyeInnerCornerIndex: any, eyeOuterCornerIndex: any, flip?: boolean): {
box: {
startPoint: number[];
endPoint: any[];
landmarks: any;
};
boxSize: number[];
crop: any;
};
getEyeCoords(eyeData: any, eyeBox: any, eyeBoxSize: any, flip?: boolean): {
rawCoords: any[][];
iris: any[][];
};
getAdjustedIrisCoords(rawCoords: any, irisCoords: any, direction: any): any;
predict(input: any, config: any): Promise<any>;
calculateLandmarksBoundingBox(landmarks: any): {
startPoint: number[];
endPoint: number[];
landmarks: any;
};
}
}
declare module "blazeface/facemesh" {
export class MediaPipeFaceMesh {
facePipeline: any;
config: any;
constructor(blazeFace: any, blazeMeshModel: any, irisModel: any, config: any);
estimateFaces(input: any, config: any): Promise<{
confidence: any;
boxConfidence: any;
faceConfidence: any;
box: any;
mesh: any;
boxRaw: any;
meshRaw: any;
annotations: any;
image: any;
}[]>;
}
export function load(config: any): Promise<MediaPipeFaceMesh>;
}
declare module "profile" {
export const data: {};
export function run(name: string, raw: any): void;
}
declare module "age/age" {
export function load(config: any): Promise<any>;
export function predict(image: any, config: any): Promise<unknown>;
}
declare module "gender/gender" {
export function load(config: any): Promise<any>;
export function predict(image: any, config: any): Promise<unknown>;
}
declare module "emotion/emotion" {
export function load(config: any): Promise<any>;
export function predict(image: any, config: any): Promise<unknown>;
}
declare module "embedding/embedding" {
type Tensor = {};
export function load(config: any): Promise<any>;
export function simmilarity(embedding1: any, embedding2: any, order?: number): Number;
export function match(embedding: Array<Number>, db: Array<any>, threshold?: number): {
simmilarity: number;
name: string;
source: string;
embedding: never[];
};
export function enhance(input: any): Tensor;
export function predict(input: any, config: any): Promise<number[]>;
}
declare module "posenet/modelBase" {
export class BaseModel {
model: any;
constructor(model: any);
predict(input: any): any;
dispose(): void;
}
}
declare module "posenet/heapSort" {
export class MaxHeap {
priorityQueue: any;
numberOfElements: number;
getElementValue: any;
constructor(maxSize: any, getElementValue: any);
enqueue(x: any): void;
dequeue(): any;
empty(): boolean;
size(): number;
all(): any;
max(): any;
swim(k: any): void;
sink(k: any): void;
getValueAt(i: any): any;
less(i: any, j: any): boolean;
exchange(i: any, j: any): void;
}
}
declare module "posenet/buildParts" {
import * as heapSort from "posenet/heapSort";
export function buildPartWithScoreQueue(scoreThreshold: any, localMaximumRadius: any, scores: any): heapSort.MaxHeap;
}
declare module "posenet/keypoints" {
export const partNames: string[];
export const NUM_KEYPOINTS: any;
export const partIds: any;
export const connectedPartIndices: any[][];
export const poseChain: string[][];
export const partChannels: string[];
}
declare module "posenet/vectors" {
export function getOffsetPoint(y: any, x: any, keypoint: any, offsets: any): {
y: any;
x: any;
};
export function getImageCoords(part: any, outputStride: any, offsets: any): {
x: any;
y: any;
};
export function fillArray(element: any, size: any): any[];
export function clamp(a: any, min: any, max: any): any;
export function squaredDistance(y1: any, x1: any, y2: any, x2: any): number;
export function addVectors(a: any, b: any): {
x: any;
y: any;
};
export function clampVector(a: any, min: any, max: any): {
y: any;
x: any;
};
}
declare module "posenet/decoders" {
export function getPointsConfidence(heatmapScores: any, heatMapCoords: any): Float32Array;
export function getOffsetVectors(heatMapCoordsBuffer: any, offsetsBuffer: any): any;
export function getOffsetPoints(heatMapCoordsBuffer: any, outputStride: any, offsetsBuffer: any): any;
export function argmax2d(inputs: any): any;
}
declare module "posenet/decodePose" {
export function decodePose(root: any, scores: any, offsets: any, outputStride: any, displacementsFwd: any, displacementsBwd: any): any[];
export function decodeSinglePose(heatmapScores: any, offsets: any, minScore: any): Promise<{
keypoints: {
position: {
y: any;
x: any;
};
part: string;
score: number;
}[];
score: number;
}>;
}
declare module "posenet/decodeMultiple" {
export function decodeMultiplePoses(scoresBuffer: any, offsetsBuffer: any, displacementsFwdBuffer: any, displacementsBwdBuffer: any, nmsRadius: any, maxDetections: any, scoreThreshold: any): {
keypoints: any;
score: number;
}[];
}
declare module "posenet/util" {
export function eitherPointDoesntMeetConfidence(a: any, b: any, minConfidence: any): boolean;
export function getAdjacentKeyPoints(keypoints: any, minConfidence: any): any[];
export function getBoundingBox(keypoints: any): any;
export function getBoundingBoxPoints(keypoints: any): {
x: any;
y: any;
}[];
export function toTensorBuffers3D(tensors: any): Promise<[unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]>;
export function scalePose(pose: any, scaleY: any, scaleX: any): {
score: any;
keypoints: any;
};
export function resizeTo(image: any, [targetH, targetW]: [any, any]): any;
export function scaleAndFlipPoses(poses: any, [height, width]: [any, any], [inputResolutionHeight, inputResolutionWidth]: [any, any]): any;
}
declare module "posenet/posenet" {
export class PoseNet {
baseModel: any;
inputSize: number;
constructor(model: any);
estimatePoses(input: any, config: any): Promise<unknown>;
dispose(): void;
}
export function load(config: any): Promise<PoseNet>;
}
declare module "handpose/box" {
export function getBoxSize(box: any): number[];
export function getBoxCenter(box: any): any[];
export function cutBoxFromImageAndResize(box: any, image: any, cropSize: any): any;
export function scaleBoxCoordinates(box: any, factor: any): {
startPoint: number[];
endPoint: number[];
palmLandmarks: any;
confidence: any;
};
export function enlargeBox(box: any, factor?: number): {
startPoint: number[];
endPoint: any[];
palmLandmarks: any;
};
export function squarifyBox(box: any): {
startPoint: number[];
endPoint: any[];
palmLandmarks: any;
};
export function shiftBox(box: any, shiftFactor: any): {
startPoint: any[];
endPoint: any[];
palmLandmarks: any;
};
}
declare module "handpose/handdetector" {
export class HandDetector {
model: any;
anchors: any;
anchorsTensor: any;
inputSize: number;
inputSizeTensor: any;
doubleInputSizeTensor: any;
constructor(model: any, inputSize: any, anchorsAnnotated: any);
normalizeBoxes(boxes: any): any;
normalizeLandmarks(rawPalmLandmarks: any, index: any): any;
getBoxes(input: any, config: any): Promise<{
box: any;
palmLandmarks: any;
confidence: number;
}[]>;
estimateHandBounds(input: any, config: any): Promise<{}[]>;
}
}
declare module "handpose/util" {
export function normalizeRadians(angle: any): number;
export function computeRotation(point1: any, point2: any): number;
export const buildTranslationMatrix: (x: any, y: any) => any[][];
export function dot(v1: any, v2: any): number;
export function getColumnFrom2DArr(arr: any, columnIndex: any): number[];
export function multiplyTransformMatrices(mat1: any, mat2: any): number[][];
export function buildRotationMatrix(rotation: any, center: any): number[][];
export function invertTransformMatrix(matrix: any): any[][];
export function rotatePoint(homogeneousCoordinate: any, rotationMatrix: any): number[];
}
declare module "handpose/handpipeline" {
export class HandPipeline {
handDetector: any;
landmarkDetector: any;
inputSize: number;
storedBoxes: any;
skipped: number;
detectedHands: number;
constructor(handDetector: any, landmarkDetector: any, inputSize: any);
getBoxForPalmLandmarks(palmLandmarks: any, rotationMatrix: any): {
startPoint: number[];
endPoint: any[];
palmLandmarks: any;
};
getBoxForHandLandmarks(landmarks: any): {
startPoint: number[];
endPoint: any[];
palmLandmarks: any;
};
transformRawCoords(rawCoords: any, box2: any, angle: any, rotationMatrix: any): any;
estimateHands(image: any, config: any): Promise<{}[]>;
calculateLandmarksBoundingBox(landmarks: any): {
startPoint: number[];
endPoint: number[];
};
}
}
declare module "handpose/anchors" {
export const anchors: {
w: number;
h: number;
x_center: number;
y_center: number;
}[];
}
declare module "handpose/handpose" {
export class HandPose {
handPipeline: any;
constructor(handPipeline: any);
static getAnnotations(): {
thumb: number[];
indexFinger: number[];
middleFinger: number[];
ringFinger: number[];
pinky: number[];
palmBase: number[];
};
estimateHands(input: any, config: any): Promise<{
confidence: number;
box: any;
boxRaw: any;
landmarks: any;
annotations: any;
}[]>;
}
export function load(config: any): Promise<HandPose>;
}
declare module "blazepose/annotations" {
export const full: string[];
export const upper: string[];
}
declare module "blazepose/blazepose" {
export function load(config: any): Promise<any>;
export function predict(image: any, config: any): Promise<{
keypoints: {
id: any;
part: any;
position: {
x;
y;
z;
};
score: any;
presence: any;
}[];
}[] | null>;
}
declare module "nanodet/nanodet" {
export function load(config: any): Promise<any>;
export function predict(image: any, config: any): Promise<unknown>;
}
declare module "gesture/gesture" {
export const body: (res: any) => {
body: number;
gesture: string;
}[];
export const face: (res: any) => {
face: number;
gesture: string;
}[];
export const iris: (res: any) => {
iris: number;
gesture: string;
}[];
export const hand: (res: any) => {
hand: number;
gesture: string;
}[];
}
declare module "image/image" {
import * as tf from '../../dist/tfjs.esm.js';
export function process(input: any, config: any): {
tensor: tf.Tensor;
canvas: OffscreenCanvas | HTMLCanvasElement;
};
}
declare module "config" {
/**
* Configuration interface definition for **Human** library
*
* Contains all configurable parameters
*/
export interface Config {
backend: String;
wasmPath: String;
debug: Boolean;
async: Boolean;
profile: Boolean;
deallocate: Boolean;
scoped: Boolean;
videoOptimized: Boolean;
warmup: String;
filter: {
enabled: Boolean;
width: Number;
height: Number;
return: Boolean;
brightness: Number;
contrast: Number;
sharpness: Number;
blur: Number;
saturation: Number;
hue: Number;
negative: Boolean;
sepia: Boolean;
vintage: Boolean;
kodachrome: Boolean;
technicolor: Boolean;
polaroid: Boolean;
pixelate: Number;
};
gesture: {
enabled: Boolean;
};
face: {
enabled: Boolean;
detector: {
modelPath: String;
rotation: Boolean;
maxFaces: Number;
skipFrames: Number;
skipInitial: Boolean;
minConfidence: Number;
iouThreshold: Number;
scoreThreshold: Number;
return: Boolean;
};
mesh: {
enabled: Boolean;
modelPath: String;
};
iris: {
enabled: Boolean;
modelPath: String;
};
age: {
enabled: Boolean;
modelPath: String;
skipFrames: Number;
};
gender: {
enabled: Boolean;
minConfidence: Number;
modelPath: String;
skipFrames: Number;
};
emotion: {
enabled: Boolean;
minConfidence: Number;
skipFrames: Number;
modelPath: String;
};
embedding: {
enabled: Boolean;
modelPath: String;
};
};
body: {
enabled: Boolean;
modelPath: String;
maxDetections: Number;
scoreThreshold: Number;
nmsRadius: Number;
};
hand: {
enabled: Boolean;
rotation: Boolean;
skipFrames: Number;
skipInitial: Boolean;
minConfidence: Number;
iouThreshold: Number;
scoreThreshold: Number;
maxHands: Number;
landmarks: Boolean;
detector: {
modelPath: String;
};
skeleton: {
modelPath: String;
};
};
object: {
enabled: Boolean;
modelPath: String;
minConfidence: Number;
iouThreshold: Number;
maxResults: Number;
skipFrames: Number;
};
}
const config: Config;
export { config as defaults };
}
declare module "draw/draw" {
export const drawOptions: {
color: string;
labelColor: string;
shadowColor: string;
font: string;
lineHeight: number;
lineWidth: number;
pointSize: number;
roundRect: number;
drawPoints: Boolean;
drawLabels: Boolean;
drawBoxes: Boolean;
drawPolygons: Boolean;
fillPolygons: Boolean;
useDepth: Boolean;
useCurves: Boolean;
bufferedOutput: Boolean;
useRawBoxes: Boolean;
};
export function gesture(inCanvas: HTMLCanvasElement, result: Array<any>): Promise<void>;
export function face(inCanvas: HTMLCanvasElement, result: Array<any>): Promise<void>;
export function body(inCanvas: HTMLCanvasElement, result: Array<any>): Promise<void>;
export function hand(inCanvas: HTMLCanvasElement, result: Array<any>): Promise<void>;
export function object(inCanvas: HTMLCanvasElement, result: Array<any>): Promise<void>;
export function canvas(inCanvas: HTMLCanvasElement, outCanvas: HTMLCanvasElement): Promise<void>;
export function all(inCanvas: HTMLCanvasElement, result: any): Promise<void>;
}
declare module "result" {
/**
* Result interface definition for **Human** library
*
* Contains all possible detection results
*/
export interface Result {
/** 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
*
* Array of individual results with one object per detected face
* Each result has:
* - overal detection confidence value
* - box detection confidence value
* - mesh detection confidence value
* - box as array of [x, y, width, height], normalized to image resolution
* - boxRaw as array of [x, y, width, height], normalized to range 0..1
* - mesh as array of [x, y, z] points of face mesh, normalized to image resolution
* - meshRaw as array of [x, y, z] points of face mesh, normalized to range 0..1
* - annotations as array of annotated face mesh points
* - age as value
* - gender as value
* - genderConfidence as value
* - emotion as array of possible emotions with their individual scores
* - iris as distance value
* - angle as object with values for roll, yaw and pitch angles
*/
face: Array<{
confidence: Number;
boxConfidence: Number;
faceConfidence: Number;
box: [Number, Number, Number, Number];
boxRaw: [Number, Number, Number, Number];
mesh: Array<[Number, Number, Number]>;
meshRaw: Array<[Number, Number, Number]>;
annotations: Array<{
part: String;
points: Array<[Number, Number, Number]>[];
}>;
age: Number;
gender: String;
genderConfidence: Number;
emotion: Array<{
score: Number;
emotion: String;
}>;
embedding: Array<Number>;
iris: Number;
angle: {
roll: Number;
yaw: Number;
pitch: Number;
};
}>;
/** Body results
*
* Array of individual results with one object per detected body
* Each results has:
* - body id number
* - body part name
* - part position with x,y,z coordinates
* - body part score value
* - body part presence value
*/
body: Array<{
id: Number;
part: String;
position: {
x: Number;
y: Number;
z: Number;
};
score: Number;
presence: Number;
}>;
/** Hand results
*
* Array of individual results with one object per detected hand
* Each result has:
* - confidence as value
* - box as array of [x, y, width, height], normalized to image resolution
* - boxRaw as array of [x, y, width, height], normalized to range 0..1
* - landmarks as array of [x, y, z] points of hand, normalized to image resolution
* - annotations as array of annotated face landmark points
*/
hand: Array<{
confidence: Number;
box: [Number, Number, Number, Number];
boxRaw: [Number, Number, Number, Number];
landmarks: Array<[Number, Number, Number]>;
annotations: Array<{
part: String;
points: Array<[Number, Number, Number]>[];
}>;
}>;
/** Gesture results
*
* Array of individual results with one object per detected gesture
* Each result has:
* - part where gesture was detected
* - gesture detected
*/
gesture: Array<{
part: String;
gesture: String;
}>;
/** Object results
*
* Array of individual results with one object per detected gesture
* Each result has:
* - score as value
* - label as detected class name
* - center as array of [x, y], normalized to image resolution
* - centerRaw as array of [x, y], normalized to range 0..1
* - box as array of [x, y, width, height], normalized to image resolution
* - boxRaw as array of [x, y, width, height], normalized to range 0..1
*/
object: Array<{
score: Number;
strideSize: Number;
class: Number;
label: String;
center: Number[];
centerRaw: Number[];
box: Number[];
boxRaw: Number[];
}>;
performance: {
any: any;
};
canvas: OffscreenCanvas | HTMLCanvasElement;
}
}
declare module "sample" {
export const face = "\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob\nIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgo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Pq1sl5Q\nVbkz9+rRy35rxHqzmZlVEe/Ez5LRlW5iyfR6zffaIjq1OSNZps2a21rZInafSPJhxGMl9LStLRWM\nlorM/A4dkrWbYfLZC2W/7K6eubX6b4RzT+W76K8b7G6X62cu3Sten59nsm3j+OXz3/0ANGIAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAA
}
declare module "human" {
import * as tf from '../dist/tfjs.esm.js';
import * as facemesh from "blazeface/facemesh";
import * as age from "age/age";
import * as gender from "gender/gender";
import * as emotion from "emotion/emotion";
import * as posenet from "posenet/posenet";
import * as handpose from "handpose/handpose";
import * as blazepose from "blazepose/blazepose";
import * as nanodet from "nanodet/nanodet";
import * as draw from "draw/draw";
import { Config } from "config";
import { Result } from "result";
type Tensor = {};
type Model = {};
export type { Config } from "config";
export type { Result } from "result";
/** Defines all possible input types for **Human** detection */
export type Input = Tensor | ImageData | ImageBitmap | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas;
/** Error message */
export type Error = {
error: String;
};
export type TensorFlow = typeof tf;
/**
* **Human** library main class
*
* All methods and properties are available only as members of Human class
*
* - Configuration object definition: {@link Config}
* - Results object definition: {@link Result}
* - Possible inputs: {@link Input}
*/
export class Human {
#private;
version: String;
config: Config;
state: String;
image: {
tensor: Tensor;
canvas: OffscreenCanvas | HTMLCanvasElement;
};
tf: TensorFlow;
draw: {
drawOptions?: typeof draw.drawOptions;
gesture: typeof draw.gesture;
face: typeof draw.face;
body: typeof draw.body;
hand: typeof draw.hand;
canvas: typeof draw.canvas;
all: typeof draw.all;
};
models: {
face: facemesh.MediaPipeFaceMesh | null;
posenet: posenet.PoseNet | null;
blazepose: Model | null;
handpose: handpose.HandPose | null;
iris: Model | null;
age: Model | null;
gender: Model | null;
emotion: Model | null;
embedding: Model | null;
nanodet: Model | null;
};
classes: {
facemesh: typeof facemesh;
age: typeof age;
gender: typeof gender;
emotion: typeof emotion;
body: typeof posenet | typeof blazepose;
hand: typeof handpose;
nanodet: typeof nanodet;
};
sysinfo: {
platform: String;
agent: String;
};
constructor(userConfig?: Config | Object);
profileData(): {
newBytes: any;
newTensors: any;
peakBytes: any;
numKernelOps: any;
timeKernelOps: any;
slowestKernelOps: any;
largestKernelOps: any;
} | {};
simmilarity(embedding1: Array<Number>, embedding2: Array<Number>): Number;
enhance(input: Tensor): Tensor | null;
match(faceEmbedding: Array<Number>, db: Array<{
name: String;
source: String | undefined;
embedding: Array<Number>;
}>, threshold?: number): {
name: String;
source: String | undefined;
simmilarity: Number;
embedding: Array<Number>;
};
load(userConfig?: Config | Object): Promise<void>;
detect(input: Input, userConfig?: Config | Object): Promise<Result | Error>;
warmup(userConfig?: Config | Object): Promise<Result | {
error: any;
}>;
}
/**
* Class Human is also available as default export
*/
export { Human as default };
}