human/src/exports.ts

48 lines
2.1 KiB
TypeScript
Raw Normal View History

2021-10-25 19:09:00 +02:00
import type { env } from './util/env';
2022-04-01 15:12:04 +02:00
import type { Tensor } from './tfjs/types';
2021-10-25 19:09:00 +02:00
2022-04-01 15:12:04 +02:00
/* Export configuration details */
2021-10-25 19:09:00 +02:00
export * from './config';
2022-04-01 15:12:04 +02:00
/* Export results details */
2021-10-25 19:09:00 +02:00
export * from './result';
2022-04-01 15:12:04 +02:00
/* Explict reexport of main @tensorflow/tfjs types */
2021-11-17 21:45:49 +01:00
export type { Tensor, TensorLike, GraphModel, Rank } from './tfjs/types';
2022-04-01 15:12:04 +02:00
2022-04-11 17:45:24 +02:00
export type { DrawOptions } from './draw/options';
2021-10-25 19:09:00 +02:00
export type { Descriptor } from './face/match';
export type { Box, Point } from './result';
export type { Models } from './models';
export type { Env } from './util/env';
export type { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';
2021-12-15 15:26:32 +01:00
export type { Emotion, Finger, FingerCurl, FingerDirection, HandType, Gender, Race, FaceLandmark, BodyLandmark, BodyAnnotation, ObjectType } from './result';
2021-10-25 19:09:00 +02:00
export { env } from './util/env';
/** 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 processed
* - `result`: triggered when detection is complete
* - `warmup`: triggered when warmup is complete
*/
export type Events = 'create' | 'load' | 'image' | 'result' | 'warmup' | 'error';
/** Defines all possible canvas types */
export type AnyCanvas = HTMLCanvasElement | OffscreenCanvas;
/** Defines all possible image types */
export type AnyImage = HTMLImageElement | typeof Image
/** Defines all possible video types */
export type AnyVideo = HTMLMediaElement | HTMLVideoElement
/** Defines all possible image objects */
export type ImageObjects = ImageData | ImageBitmap
/** Defines possible externally defined canvas */
export type ExternalCanvas = typeof env.Canvas;
/** Defines all possible input types for **Human** detection */
export type Input = Tensor | AnyCanvas | AnyImage | AnyVideo | ImageObjects | ExternalCanvas;
2022-07-18 03:31:08 +02:00
/** Defines model stats */
export type { ModelStats } from './models';
/** Defines individual model sizes */
export type { ModelInfo } from './tfjs/load';
2022-08-10 19:50:33 +02:00
/** Defines model kernel ops */
export type { KernelOps } from './models';