Options
All
  • Public
  • Public/Protected
  • All
Menu

@vladmandic/human - v2.5.1

Index

References

default

Renames and re-exports Human

Type aliases

AnyCanvas

AnyCanvas: HTMLCanvasElement | OffscreenCanvas

Defines all possible canvas types

AnyImage

AnyImage: HTMLImageElement | typeof Image

Defines all possible image types

AnyVideo

AnyVideo: HTMLMediaElement | HTMLVideoElement

Defines all possible video types

BodyGesture

BodyGesture: `leaning ${"left" | "right"}` | `raise ${"left" | "right"} hand` | "i give up"

Box

Box: [number, number, number, number]

generic box as [x, y, width, height]

Descriptor

Descriptor: number[]

Face descriptor type as number array

DrawOptions

DrawOptions: { color: string; drawBoxes: boolean; drawGaze: boolean; drawGestures: boolean; drawLabels: boolean; drawPoints: boolean; drawPolygons: boolean; fillPolygons: boolean; font: string; labelColor: string; lineHeight: number; lineWidth: number; pointSize: number; roundRect: number; shadowColor: string; useCurves: boolean; useDepth: boolean }

Draw Options

  • Accessed via human.draw.options or provided per each draw method as the drawOptions optional parameter

Type declaration

  • color: string

    draw line color

  • drawBoxes: boolean

    should draw boxes around detection results?

  • drawGaze: boolean

    should draw gaze arrows?

  • drawGestures: boolean

    should detected gestures be drawn?

  • drawLabels: boolean

    should labels be drawn?

  • drawPoints: boolean

    should points be drawn?

  • drawPolygons: boolean

    should draw polygons from detection points?

  • fillPolygons: boolean

    should fill polygons?

  • font: string

    label font

  • labelColor: string

    label color

  • lineHeight: number

    line spacing between labels

  • lineWidth: number

    line width for drawn lines

  • pointSize: number

    size of drawn points

  • roundRect: number

    draw rounded boxes by n pixels

  • shadowColor: string

    label shadow color

  • useCurves: boolean

    should lines be curved?

  • useDepth: boolean

    use z-coordinate when available

Error

Error: { error: string }

Error message

Type declaration

  • error: string
    property

    error message

Events

Events: "create" | "load" | "image" | "result" | "warmup" | "error"

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

ExternalCanvas

ExternalCanvas: typeof Canvas

Defines possible externally defined canvas

FaceGesture

FaceGesture: `facing ${"left" | "center" | "right"}` | `blink ${"left" | "right"} eye` | `mouth ${number}% open` | `head ${"up" | "down"}`

GestureResult

GestureResult: { face: number; gesture: FaceGesture } | { gesture: IrisGesture; iris: number } | { body: number; gesture: BodyGesture } | { gesture: HandGesture; hand: number }

Gesture combined results

HandGesture

HandGesture: `${"thumb" | "index" | "middle" | "ring" | "pinky"} forward` | `${"thumb" | "index" | "middle" | "ring" | "pinky"} up` | "victory" | "thumbs up"

ImageObjects

ImageObjects: ImageData | ImageBitmap

Defines all possible image objects

Input

Defines all possible input types for Human detection

IrisGesture

IrisGesture: "facing center" | `looking ${"left" | "right" | "up" | "down"}` | "looking center"

Point

Point: [number, number, number?]

generic point as [x, y, z?]

TensorFlow

TensorFlow: typeof tf

Instance of TensorFlow/JS used by Human

  • Can be TFJS that is bundled with Human or a manually imported TFJS library
external

API

Variables

defaults

defaults: Config = ...

env

env: Env = ...