Options
All
  • Public
  • Public/Protected
  • All
Menu

@vladmandic/human - v2.5.5

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

BackendType

BackendType: ["cpu", "wasm", "webgl", "humangl", "tensorflow", "webgpu"]

Possible TensorFlow backends

BodyAnnotation

BodyAnnotationBlazePose

BodyAnnotationBlazePose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "leftEye" | "rightEye" | "mouth"

BodyAnnotationEfficientPose

BodyAnnotationEfficientPose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "head"

BodyGesture

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

body gesture type

BodyLandmark

BodyLandmarkBlazePose

BodyLandmarkBlazePose: "nose" | "leftEyeInside" | "leftEye" | "leftEyeOutside" | "rightEyeInside" | "rightEye" | "rightEyeOutside" | "leftEar" | "rightEar" | "leftMouth" | "rightMouth" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftPinky" | "rightPinky" | "leftIndex" | "rightIndex" | "leftThumb" | "rightThumb" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle" | "leftHeel" | "rightHeel" | "leftFoot" | "rightFoot" | "bodyCenter" | "bodyTop" | "leftPalm" | "leftHand" | "rightPalm" | "rightHand"

BodyLandmarkEfficientNet

BodyLandmarkEfficientNet: "head" | "neck" | "rightShoulder" | "rightElbow" | "rightWrist" | "chest" | "leftShoulder" | "leftElbow" | "leftWrist" | "bodyCenter" | "rightHip" | "rightKnee" | "rightAnkle" | "leftHip" | "leftKnee" | "leftAnkle"

BodyLandmarkMoveNet

BodyLandmarkMoveNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"

BodyLandmarkPoseNet

BodyLandmarkPoseNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"

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

Emotion

Emotion: "angry" | "disgust" | "fear" | "happy" | "sad" | "surprise" | "neutral"

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"}`

face gesture type

FaceLandmark

FaceLandmark: "leftEye" | "rightEye" | "nose" | "mouth" | "leftEar" | "rightEar" | "symmetryLine" | "silhouette" | "lipsUpperOuter" | "lipsLowerOuter" | "lipsUpperInner" | "lipsLowerInner" | "rightEyeUpper0" | "rightEyeLower0" | "rightEyeUpper1" | "rightEyeLower1" | "rightEyeUpper2" | "rightEyeLower2" | "rightEyeLower3" | "rightEyebrowUpper" | "rightEyebrowLower" | "rightEyeIris" | "leftEyeUpper0" | "leftEyeLower0" | "leftEyeUpper1" | "leftEyeLower1" | "leftEyeUpper2" | "leftEyeLower2" | "leftEyeLower3" | "leftEyebrowUpper" | "leftEyebrowLower" | "leftEyeIris" | "midwayBetweenEyes" | "noseTip" | "noseBottom" | "noseRightCorner" | "noseLeftCorner" | "rightCheek" | "leftCheek"

Finger

Finger: "index" | "middle" | "pinky" | "ring" | "thumb" | "palm"

FingerCurl

FingerCurl: "none" | "half" | "full"

FingerDirection

FingerDirection: "verticalUp" | "verticalDown" | "horizontalLeft" | "horizontalRight" | "diagonalUpRight" | "diagonalUpLeft" | "diagonalDownRight" | "diagonalDownLeft"

Gender

Gender: "male" | "female" | "unknown"

GestureResult

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

Gesture combined results Each result has:

  • part: part name and number where gesture was detected: face, iris, body, hand
  • gesture: gesture detected

HandGesture

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

hand gesture type

HandType

HandType: "hand" | "fist" | "pinch" | "point" | "face" | "tip" | "pinchtip"

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"

iris gesture type

ObjectType

ObjectType: "person" | "bicycle" | "car" | "motorcycle" | "airplane" | "bus" | "train" | "truck" | "boat" | "traffic light" | "fire hydrant" | "stop sign" | "parking meter" | "bench" | "bird" | "cat" | "dog" | "horse" | "sheep" | "cow" | "elephant" | "bear" | "zebra" | "giraffe" | "backpack" | "umbrella" | "handbag" | "tie" | "suitcase" | "frisbee" | "skis" | "snowboard" | "sports ball" | "kite" | "baseball bat" | "baseball glove" | "skateboard" | "surfboard" | "tennis racket" | "bottle" | "wine glass" | "cup" | "fork" | "knife" | "spoon" | "bowl" | "banana" | "apple" | "sandwich" | "orange" | "broccoli" | "carrot" | "hot dog" | "pizza" | "donut" | "cake" | "chair" | "couch" | "potted plant" | "bed" | "dining table" | "toilet" | "tv" | "laptop" | "mouse" | "remote" | "keyboard" | "cell phone" | "microwave" | "oven" | "toaster" | "sink" | "refrigerator" | "book" | "clock" | "vase" | "scissors" | "teddy bear" | "hair drier" | "toothbrush"

Point

Point: [number, number, number?]

generic point as [x, y, z?]

Race

Race: "white" | "black" | "asian" | "indian" | "other"

TensorLike

TensorLike: TypedArray | number | boolean | string | RecursiveArray<number | number[] | TypedArray> | RecursiveArray<boolean> | RecursiveArray<string> | Uint8Array[]
docalias

TypedArray|Array

WarmupType

WarmupType: ["" | "none" | "face" | "full" | "body"]

Possible values for human.warmup

Variables

defaults

defaults: Config = ...

env

env: Env = ...