## Index

### Namespaces

- draw
- utils

### Enumerations

- Gender

### Classes

- AgeGenderNet
- BoundingBox
- Box
- ComposableTask
- ComputeAllFaceDescriptorsTask
- ComputeFaceDescriptorsTaskBase
- ComputeSingleFaceDescriptorTask
- DetectAllFaceLandmarksTask
- DetectAllFacesTask
- DetectFaceLandmarksTaskBase
- DetectFacesTaskBase
- DetectSingleFaceLandmarksTask
- DetectSingleFaceTask
- Dimensions
- FaceDetection
- FaceDetectionNet
- FaceExpressionNet
- FaceExpressions
- FaceLandmark68Net
- FaceLandmark68TinyNet
- FaceLandmarkNet
- FaceLandmarks
- FaceLandmarks5
- FaceLandmarks68
- FaceMatch
- FaceMatcher
- FaceRecognitionNet
- LabeledBox
- LabeledFaceDescriptors
- NetInput
- NeuralNetwork
- ObjectDetection
- Point
- PredictedBox
- Rect
- SsdMobilenetv1
- SsdMobilenetv1Options
- TinyFaceDetector
- TinyFaceDetectorOptions
- TinyYolov2
- TinyYolov2Options

### Interfaces

- IBoundingBox
- IDimensions
- IFaceDetecion
- IFaceLandmarks
- IFaceMatch
- IPoint
- IRect
- ISsdMobilenetv1Options
- ITinyFaceDetectorOptions
- ITinyYolov2Options

### Type aliases

- AgeAndGenderPrediction
- BatchNorm
- ConvWithBatchNorm
- DefaultTinyYolov2NetParams
- Environment
- FaceDetectionFunction
- FaceDetectionOptions
- FileSystem
- MobilenetParams
- NetOutput
- NetParams
- TMediaElement
- TNetInput
- TNetInputArg
- TResolvedNetInput
- TinyYolov2Config
- TinyYolov2NetParams
- WithAge
- WithFaceDescriptor
- WithFaceDetection
- WithFaceExpressions
- WithFaceLandmarks
- WithGender

### Variables

- FACE_EXPRESSION_LABELS
- env
- nets
- version

### Functions

- allFaces
- allFacesSsdMobilenetv1
- allFacesTinyYolov2
- awaitMediaLoaded
- bufferToImage
- computeFaceDescriptor
- createCanvas
- createCanvasFromMedia
- createFaceDetectionNet
- createFaceRecognitionNet
- createSsdMobilenetv1
- createTinyFaceDetector
- createTinyYolov2
- detectAllFaces
- detectFaceLandmarks
- detectFaceLandmarksTiny
- detectLandmarks
- detectSingleFace
- euclideanDistance
- extendWithAge
- extendWithFaceDescriptor
- extendWithFaceDetection
- extendWithFaceExpressions
- extendWithFaceLandmarks
- extendWithGender
- extractFaceTensors
- extractFaces
- fetchImage
- fetchJson
- fetchNetWeights
- fetchOrThrow
- getContext2dOrThrow
- getMediaDimensions
- imageTensorToCanvas
- imageToSquare
- inverseSigmoid
- iou
- isMediaElement
- isMediaLoaded
- isWithAge
- isWithFaceDetection
- isWithFaceExpressions
- isWithFaceLandmarks
- isWithGender
- loadAgeGenderModel
- loadFaceDetectionModel
- loadFaceExpressionModel
- loadFaceLandmarkModel
- loadFaceLandmarkTinyModel
- loadFaceRecognitionModel
- loadSsdMobilenetv1Model
- loadTinyFaceDetectorModel
- loadTinyYolov2Model
- loadWeightMap
- locateFaces
- matchDimensions
- minBbox
- nonMaxSuppression
- normalize
- padToSquare
- predictAgeAndGender
- recognizeFaceExpressions
- resizeResults
- resolveInput
- shuffleArray
- sigmoid
- ssdMobilenetv1
- tf
- tinyFaceDetector
- tinyYolov2
- toNetInput
- validateConfig

## Type aliases

### AgeAndGenderPrediction

AgeAndGenderPrediction: { age: number; gender: Gender; genderProbability: number }

- Defined in ageGenderNet/types.ts:13

#### Type declaration

- ##### age: number

- ##### gender: Gender

- ##### genderProbability: number

### BatchNorm

BatchNorm: { sub: tf; truediv: tf }

- Defined in tinyYolov2/types.ts:6

#### Type declaration

- ##### sub: tf

- ##### truediv: tf

### ConvWithBatchNorm

ConvWithBatchNorm: { bn: BatchNorm; conv: ConvParams }

- Defined in tinyYolov2/types.ts:11

#### Type declaration

- ##### bn: BatchNorm

- ##### conv: ConvParams

### DefaultTinyYolov2NetParams

DefaultTinyYolov2NetParams: { conv0: ConvWithBatchNorm; conv1: ConvWithBatchNorm; conv2: ConvWithBatchNorm; conv3: ConvWithBatchNorm; conv4: ConvWithBatchNorm; conv5: ConvWithBatchNorm; conv6: ConvWithBatchNorm; conv7: ConvWithBatchNorm; conv8: ConvParams }

- Defined in tinyYolov2/types.ts:28

#### Type declaration

- ##### conv0: ConvWithBatchNorm

- ##### conv1: ConvWithBatchNorm

- ##### conv2: ConvWithBatchNorm

- ##### conv3: ConvWithBatchNorm

- ##### conv4: ConvWithBatchNorm

- ##### conv5: ConvWithBatchNorm

- ##### conv6: ConvWithBatchNorm

- ##### conv7: ConvWithBatchNorm

- ##### conv8: ConvParams

### Environment

Environment: FileSystem & { Canvas: typeof HTMLCanvasElement; CanvasRenderingContext2D: typeof CanvasRenderingContext2D; Image: typeof HTMLImageElement; ImageData: typeof ImageData; Video: typeof HTMLVideoElement; createCanvasElement: () => HTMLCanvasElement; createImageElement: () => HTMLImageElement; fetch: (url: string, init?: RequestInit) => Promise<Response> }

- Defined in env/types.ts:6

### FaceDetectionFunction

FaceDetectionFunction: (input: TNetInput) => Promise<FaceDetection[]>

- Defined in globalApi/types.ts:10

#### Type declaration

- - (input: TNetInput): Promise<FaceDetection[]>

  - #### Parameters

    - ##### input: TNetInput

    #### Returns Promise<FaceDetection[]>

### FaceDetectionOptions

FaceDetectionOptions: TinyFaceDetectorOptions | SsdMobilenetv1Options | TinyYolov2Options

- Defined in globalApi/types.ts:7

### FileSystem

FileSystem: { readFile: (filePath: string) => Promise<Buffer> }

- Defined in env/types.ts:1

#### Type declaration

- ##### readFile: (filePath: string) => Promise<Buffer>

  - - (filePath: string): Promise<Buffer>

    - #### Parameters

      - ##### filePath: string

      #### Returns Promise<Buffer>

### MobilenetParams

MobilenetParams: { conv0: SeparableConvParams | ConvParams; conv1: SeparableConvParams; conv2: SeparableConvParams; conv3: SeparableConvParams; conv4: SeparableConvParams; conv5: SeparableConvParams; conv6?: SeparableConvParams; conv7?: SeparableConvParams; conv8: ConvParams }

- Defined in tinyYolov2/types.ts:16

#### Type declaration

- ##### conv0: SeparableConvParams | ConvParams

- ##### conv1: SeparableConvParams

- ##### conv2: SeparableConvParams

- ##### conv3: SeparableConvParams

- ##### conv4: SeparableConvParams

- ##### conv5: SeparableConvParams

- ##### Optional conv6?: SeparableConvParams

- ##### Optional conv7?: SeparableConvParams

- ##### conv8: ConvParams

### NetOutput

NetOutput: { age: tf; gender: tf }

- Defined in ageGenderNet/types.ts:19

#### Type declaration

- ##### age: tf

- ##### gender: tf

### NetParams

NetParams: { fc: { age: FCParams; gender: FCParams } }

- Defined in ageGenderNet/types.ts:21

#### Type declaration

- ##### fc: { age: FCParams; gender: FCParams }

  - ##### age: FCParams

  - ##### gender: FCParams

### TMediaElement

TMediaElement: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement

- Defined in dom/types.ts:5

### TNetInput

TNetInput: TNetInputArg | TNetInputArg[] | NetInput | tf

- Defined in dom/types.ts:11

### TNetInputArg

TNetInputArg: string | TResolvedNetInput

- Defined in dom/types.ts:9

### TResolvedNetInput

TResolvedNetInput: TMediaElement | tf | tf

- Defined in dom/types.ts:7

### TinyYolov2Config

TinyYolov2Config: { anchors: Point[]; classes: string[]; filterSizes?: number[]; iouThreshold: number; isFirstLayerConv2d?: boolean; meanRgb?: [number, number, number]; withClassScores?: boolean; withSeparableConvs: boolean }

- Defined in tinyYolov2/config.ts:3

#### Type declaration

- ##### anchors: Point[]

- ##### classes: string[]

- ##### Optional filterSizes?: number[]

- ##### iouThreshold: number

- ##### Optional isFirstLayerConv2d?: boolean

- ##### Optional meanRgb?: [number, number, number]

- ##### Optional withClassScores?: boolean

- ##### withSeparableConvs: boolean

### TinyYolov2NetParams

TinyYolov2NetParams: DefaultTinyYolov2NetParams | MobilenetParams

- Defined in tinyYolov2/types.ts:40

### WithAge

WithAge<TSource>: TSource & { age: number }

- Defined in factories/WithAge.ts:1

#### Type parameters

- #### TSource

### WithFaceDescriptor

WithFaceDescriptor<TSource>: TSource & { descriptor: Float32Array }

- Defined in factories/WithFaceDescriptor.ts:1

#### Type parameters

- #### TSource

### WithFaceDetection

WithFaceDetection<TSource>: TSource & { detection: FaceDetection }

- Defined in factories/WithFaceDetection.ts:3

#### Type parameters

- #### TSource

### WithFaceExpressions

WithFaceExpressions<TSource>: TSource & { expressions: FaceExpressions }

- Defined in factories/WithFaceExpressions.ts:3

#### Type parameters

- #### TSource

### WithFaceLandmarks

WithFaceLandmarks<TSource, TFaceLandmarks>: TSource & { alignedRect: FaceDetection; angle: { pitch: number | undefined; roll: number | undefined; yaw: number | undefined }; landmarks: TFaceLandmarks; unshiftedLandmarks: TFaceLandmarks }

- Defined in factories/WithFaceLandmarks.ts:6

#### Type parameters

- #### TSource: WithFaceDetection<{}>

- #### TFaceLandmarks: FaceLandmarks = FaceLandmarks68

### WithGender

WithGender<TSource>: TSource & { gender: Gender; genderProbability: number }

- Defined in factories/WithGender.ts:4

#### Type parameters

- #### TSource

## Variables

### Const FACE_EXPRESSION_LABELS

FACE_EXPRESSION_LABELS: string[] = ...

- Defined in faceExpressionNet/FaceExpressions.ts:1

### Const env

env: { createBrowserEnv: () => Environment; createFileSystem: (fs?: any) => FileSystem; createNodejsEnv: () => Environment; getEnv: () => Environment; initialize: () => null | void; isBrowser: () => boolean; isNodejs: () => boolean; monkeyPatch: (env: Partial<Environment>) => void; setEnv: (env: Environment) => void } = ...

- Defined in env/index.ts:50

#### Type declaration

- ##### createBrowserEnv: () => Environment

  - - (): Environment

    - #### Returns Environment

- ##### createFileSystem: (fs?: any) => FileSystem

  - - (fs?: any): FileSystem

    - #### Parameters

      - ##### Optional fs: any

      #### Returns FileSystem

- ##### createNodejsEnv: () => Environment

  - - (): Environment

    - #### Returns Environment

- ##### getEnv: () => Environment

  - - (): Environment

    - #### Returns Environment

- ##### initialize: () => null | void

  - - (): null | void

    - #### Returns null | void

- ##### isBrowser: () => boolean

  - - (): boolean

    - #### Returns boolean

- ##### isNodejs: () => boolean

  - - (): boolean

    - #### Returns boolean

- ##### monkeyPatch: (env: Partial<Environment>) => void

  - - (env: Partial<Environment>): void

    - #### Parameters

      - ##### env: Partial<Environment>

      #### Returns void

- ##### setEnv: (env: Environment) => void

  - - (env: Environment): void

    - #### Parameters

      - ##### env: Environment

      #### Returns void

### Const nets

nets: { ageGenderNet: AgeGenderNet; faceExpressionNet: FaceExpressionNet; faceLandmark68Net: FaceLandmark68Net; faceLandmark68TinyNet: FaceLandmark68TinyNet; faceRecognitionNet: FaceRecognitionNet; ssdMobilenetv1: SsdMobilenetv1; tinyFaceDetector: TinyFaceDetector; tinyYolov2: TinyYolov2 } = ...

- Defined in globalApi/nets.ts:17

#### Type declaration

- ##### ageGenderNet: AgeGenderNet

- ##### faceExpressionNet: FaceExpressionNet

- ##### faceLandmark68Net: FaceLandmark68Net

- ##### faceLandmark68TinyNet: FaceLandmark68TinyNet

- ##### faceRecognitionNet: FaceRecognitionNet

- ##### ssdMobilenetv1: SsdMobilenetv1

- ##### tinyFaceDetector: TinyFaceDetector

- ##### tinyYolov2: TinyYolov2

### Const version

version: { browser: boolean; faceapi: string; node: boolean } = ...

- Defined in index.ts:27

#### Type declaration

- ##### browser: boolean

- ##### faceapi: string

- ##### node: boolean

## Functions

### Const allFaces

- allFaces(input: TNetInput, minConfidence?: number): Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

- - Defined in globalApi/allFaces.ts:19

  #### Parameters

  - ##### input: TNetInput

  - ##### Optional minConfidence: number

  #### Returns Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

### allFacesSsdMobilenetv1

- allFacesSsdMobilenetv1(input: TNetInput, minConfidence?: number): Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

- - Defined in globalApi/allFaces.ts:7

  #### Parameters

  - ##### input: TNetInput

  - ##### Optional minConfidence: number

  #### Returns Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

### allFacesTinyYolov2

- allFacesTinyYolov2(input: TNetInput, forwardParams?: ITinyYolov2Options): Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

- - Defined in globalApi/allFaces.ts:13

  #### Parameters

  - ##### input: TNetInput

  - ##### forwardParams: ITinyYolov2Options = {}

  #### Returns Promise<WithFaceDescriptor<WithFaceLandmarks<WithFaceDetection<{}>>>[]>

### awaitMediaLoaded

- awaitMediaLoaded(media: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement): Promise<unknown>

- - Defined in dom/awaitMediaLoaded.ts:4

  #### Parameters

  - ##### media: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement

  #### Returns Promise<unknown>

### bufferToImage

- bufferToImage(buf: Blob): Promise<HTMLImageElement>

- - Defined in dom/bufferToImage.ts:3

  #### Parameters

  - ##### buf: Blob

  #### Returns Promise<HTMLImageElement>

### Const computeFaceDescriptor

- computeFaceDescriptor(input: any): Promise<Float32Array | Float32Array[]>

- - Defined in globalApi/nets.ts:85

  Computes a 128 entry vector (face descriptor / face embeddings) from the face shown in an image, which uniquely represents the features of that persons face. The computed face descriptor can be used to measure the similarity between faces, by computing the euclidean distance of two face descriptors.

  #### Parameters

  - ##### input: any

  #### Returns Promise<Float32Array | Float32Array[]>

  Face descriptor with 128 entries or array thereof in case of batch input.

### createCanvas

- createCanvas(__namedParameters: IDimensions): HTMLCanvasElement

- - Defined in dom/createCanvas.ts:7

  #### Parameters

  - ##### __namedParameters: IDimensions

  #### Returns HTMLCanvasElement

### createCanvasFromMedia

- createCanvasFromMedia(media: HTMLImageElement | HTMLVideoElement | ImageData, dims?: IDimensions): HTMLCanvasElement

- - Defined in dom/createCanvas.ts:15

  #### Parameters

  - ##### media: HTMLImageElement | HTMLVideoElement | ImageData

  - ##### Optional dims: IDimensions

  #### Returns HTMLCanvasElement

### createFaceDetectionNet

- createFaceDetectionNet(weights: Float32Array): SsdMobilenetv1

- - Defined in ssdMobilenetv1/index.ts:12

  #### Parameters

  - ##### weights: Float32Array

  #### Returns SsdMobilenetv1

### createFaceRecognitionNet

- createFaceRecognitionNet(weights: Float32Array): FaceRecognitionNet

- - Defined in faceRecognitionNet/index.ts:5

  #### Parameters

  - ##### weights: Float32Array

  #### Returns FaceRecognitionNet

### createSsdMobilenetv1

- createSsdMobilenetv1(weights: Float32Array): SsdMobilenetv1

- - Defined in ssdMobilenetv1/index.ts:6

  #### Parameters

  - ##### weights: Float32Array

  #### Returns SsdMobilenetv1

### createTinyFaceDetector

- createTinyFaceDetector(weights: Float32Array): TinyFaceDetector

- - Defined in tinyFaceDetector/index.ts:6

  #### Parameters

  - ##### weights: Float32Array

  #### Returns TinyFaceDetector

### createTinyYolov2

- createTinyYolov2(weights: Float32Array, withSeparableConvs?: boolean): TinyYolov2

- - Defined in tinyYolov2/index.ts:8

  #### Parameters

  - ##### weights: Float32Array

  - ##### withSeparableConvs: boolean = true

  #### Returns TinyYolov2

### detectAllFaces

- detectAllFaces(input: TNetInput, options?: FaceDetectionOptions): DetectAllFacesTask

- - Defined in globalApi/detectFaces.ts:10

  #### Parameters

  - ##### input: TNetInput

  - ##### options: FaceDetectionOptions = ...

  #### Returns DetectAllFacesTask

### Const detectFaceLandmarks

- detectFaceLandmarks(input: any): Promise<FaceLandmarks68 | FaceLandmarks68[]>

- - Defined in globalApi/nets.ts:62

  Detects the 68 point face landmark positions of the face shown in an image.

  #### Parameters

  - ##### input: any

  #### Returns Promise<FaceLandmarks68 | FaceLandmarks68[]>

  68 point face landmarks or array thereof in case of batch input.

### Const detectFaceLandmarksTiny

- detectFaceLandmarksTiny(input: any): Promise<FaceLandmarks68 | FaceLandmarks68[]>

- - Defined in globalApi/nets.ts:73

  Detects the 68 point face landmark positions of the face shown in an image using a tinier version of the 68 point face landmark model, which is slightly faster at inference, but also slightly less accurate.

  #### Parameters

  - ##### input: any

  #### Returns Promise<FaceLandmarks68 | FaceLandmarks68[]>

  68 point face landmarks or array thereof in case of batch input.

### Const detectLandmarks

- detectLandmarks(input: any): Promise<FaceLandmarks68 | FaceLandmarks68[]>

- - Defined in globalApi/nets.ts:117

  #### Parameters

  - ##### input: any

  #### Returns Promise<FaceLandmarks68 | FaceLandmarks68[]>

### detectSingleFace

- detectSingleFace(input: TNetInput, options?: FaceDetectionOptions): DetectSingleFaceTask

- - Defined in globalApi/detectFaces.ts:6

  #### Parameters

  - ##### input: TNetInput

  - ##### options: FaceDetectionOptions = ...

  #### Returns DetectSingleFaceTask

### euclideanDistance

- euclideanDistance(arr1: number[] | Float32Array, arr2: number[] | Float32Array): number

- - Defined in euclideanDistance.ts:1

  #### Parameters

  - ##### arr1: number[] | Float32Array

  - ##### arr2: number[] | Float32Array

  #### Returns number

### extendWithAge

- extendWithAge<TSource>(sourceObj: TSource, age: number): WithAge<TSource>

- - Defined in factories/WithAge.ts:9

  #### Type parameters

  - #### TSource

  #### Parameters

  - ##### sourceObj: TSource

  - ##### age: number

  #### Returns WithAge<TSource>

### extendWithFaceDescriptor

- extendWithFaceDescriptor<TSource>(sourceObj: TSource, descriptor: Float32Array): WithFaceDescriptor<TSource>

- - Defined in factories/WithFaceDescriptor.ts:5

  #### Type parameters

  - #### TSource

  #### Parameters

  - ##### sourceObj: TSource

  - ##### descriptor: Float32Array

  #### Returns WithFaceDescriptor<TSource>

### extendWithFaceDetection

- extendWithFaceDetection<TSource>(sourceObj: TSource, detection: FaceDetection): WithFaceDetection<TSource>

- - Defined in factories/WithFaceDetection.ts:11

  #### Type parameters

  - #### TSource

  #### Parameters

  - ##### sourceObj: TSource

  - ##### detection: FaceDetection

  #### Returns WithFaceDetection<TSource>

### extendWithFaceExpressions

- extendWithFaceExpressions<TSource>(sourceObj: TSource, expressions: FaceExpressions): WithFaceExpressions<TSource>

- - Defined in factories/WithFaceExpressions.ts:9

  #### Type parameters

  - #### TSource

  #### Parameters

  - ##### sourceObj: TSource

  - ##### expressions: FaceExpressions

  #### Returns WithFaceExpressions<TSource>

### extendWithFaceLandmarks

- extendWithFaceLandmarks<TSource, TFaceLandmarks>(sourceObj: TSource, unshiftedLandmarks: TFaceLandmarks): WithFaceLandmarks<TSource, TFaceLandmarks>

- - Defined in factories/WithFaceLandmarks.ts:60

  #### Type parameters

  - #### TSource: { detection: FaceDetection }

  - #### TFaceLandmarks: FaceLandmarks<TFaceLandmarks> = FaceLandmarks68

  #### Parameters

  - ##### sourceObj: TSource

  - ##### unshiftedLandmarks: TFaceLandmarks

  #### Returns WithFaceLandmarks<TSource, TFaceLandmarks>

### extendWithGender

- extendWithGender<TSource>(sourceObj: TSource, gender: Gender, genderProbability: number): WithGender<TSource>

- - Defined in factories/WithGender.ts:14

  #### Type parameters

  - #### TSource

  #### Parameters

  - ##### sourceObj: TSource

  - ##### gender: Gender

  - ##### genderProbability: number

  #### Returns WithGender<TSource>

### extractFaceTensors

- extractFaceTensors(imageTensor: tf | tf, detections: (FaceDetection | Rect)[]): Promise<tf[]>

- - Defined in dom/extractFaceTensors.ts:17

  Extracts the tensors of the image regions containing the detected faces. Useful if you want to compute the face descriptors for the face images. Using this method is faster then extracting a canvas for each face and converting them to tensors individually.

  #### Parameters

  - ##### imageTensor: tf | tf

    The image tensor that face detection has been performed on.

  - ##### detections: (FaceDetection | Rect)[]

    The face detection results or face bounding boxes for that image.

  #### Returns Promise<tf[]>

  Tensors of the corresponding image region for each detected face.

### extractFaces

- extractFaces(input: TNetInput, detections: (FaceDetection | Rect)[]): Promise<HTMLCanvasElement[]>

- - Defined in dom/extractFaces.ts:17

  Extracts the image regions containing the detected faces.

  #### Parameters

  - ##### input: TNetInput

    The image that face detection has been performed on.

  - ##### detections: (FaceDetection | Rect)[]

    The face detection results or face bounding boxes for that image.

  #### Returns Promise<HTMLCanvasElement[]>

  The Canvases of the corresponding image region for each detected face.

### fetchImage

- fetchImage(uri: string): Promise<HTMLImageElement>

- - Defined in dom/fetchImage.ts:4

  #### Parameters

  - ##### uri: string

  #### Returns Promise<HTMLImageElement>

### fetchJson

- fetchJson<T>(uri: string): Promise<T>

- - Defined in dom/fetchJson.ts:3

  #### Type parameters

  - #### T

  #### Parameters

  - ##### uri: string

  #### Returns Promise<T>

### fetchNetWeights

- fetchNetWeights(uri: string): Promise<Float32Array>

- - Defined in dom/fetchNetWeights.ts:3

  #### Parameters

  - ##### uri: string

  #### Returns Promise<Float32Array>

### fetchOrThrow

- fetchOrThrow(url: string, init?: RequestInit): Promise<Response>

- - Defined in dom/fetchOrThrow.ts:3

  #### Parameters

  - ##### url: string

  - ##### Optional init: RequestInit

  #### Returns Promise<Response>

### getContext2dOrThrow

- getContext2dOrThrow(canvasArg: string | HTMLCanvasElement | CanvasRenderingContext2D): CanvasRenderingContext2D

- - Defined in dom/getContext2dOrThrow.ts:4

  #### Parameters

  - ##### canvasArg: string | HTMLCanvasElement | CanvasRenderingContext2D

  #### Returns CanvasRenderingContext2D

### getMediaDimensions

- getMediaDimensions(input: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | IDimensions): Dimensions

- - Defined in dom/getMediaDimensions.ts:4

  #### Parameters

  - ##### input: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | IDimensions

  #### Returns Dimensions

### imageTensorToCanvas

- imageTensorToCanvas(imgTensor: tf, canvas?: HTMLCanvasElement): Promise<HTMLCanvasElement>

- - Defined in dom/imageTensorToCanvas.ts:6

  #### Parameters

  - ##### imgTensor: tf

  - ##### Optional canvas: HTMLCanvasElement

  #### Returns Promise<HTMLCanvasElement>

### imageToSquare

- imageToSquare(input: HTMLImageElement | HTMLCanvasElement, inputSize: number, centerImage?: boolean): HTMLCanvasElement

- - Defined in dom/imageToSquare.ts:6

  #### Parameters

  - ##### input: HTMLImageElement | HTMLCanvasElement

  - ##### inputSize: number

  - ##### centerImage: boolean = false

  #### Returns HTMLCanvasElement

### inverseSigmoid

- inverseSigmoid(x: number): number

- - Defined in ops/index.ts:12

  #### Parameters

  - ##### x: number

  #### Returns number

### iou

- iou(box1: Box, box2: Box, isIOU?: boolean): number

- - Defined in ops/iou.ts:3

  #### Parameters

  - ##### box1: Box

  - ##### box2: Box

  - ##### isIOU: boolean = true

  #### Returns number

### isMediaElement

- isMediaElement(input: any): boolean

- - Defined in dom/isMediaElement.ts:3

  #### Parameters

  - ##### input: any

  #### Returns boolean

### isMediaLoaded

- isMediaLoaded(media: HTMLImageElement | HTMLVideoElement): boolean

- - Defined in dom/isMediaLoaded.ts:3

  #### Parameters

  - ##### media: HTMLImageElement | HTMLVideoElement

  #### Returns boolean

### isWithAge

- isWithAge(obj: any): obj is { age: number }

- - Defined in factories/WithAge.ts:5

  #### Parameters

  - ##### obj: any

  #### Returns obj is { age: number }

### isWithFaceDetection

- isWithFaceDetection(obj: any): obj is { detection: FaceDetection }

- - Defined in factories/WithFaceDetection.ts:7

  #### Parameters

  - ##### obj: any

  #### Returns obj is { detection: FaceDetection }

### isWithFaceExpressions

- isWithFaceExpressions(obj: any): obj is { expressions: FaceExpressions }

- - Defined in factories/WithFaceExpressions.ts:5

  #### Parameters

  - ##### obj: any

  #### Returns obj is { expressions: FaceExpressions }

### isWithFaceLandmarks

- isWithFaceLandmarks(obj: any): obj is WithFaceLandmarks<{ detection: FaceDetection }, FaceLandmarks>

- - Defined in factories/WithFaceLandmarks.ts:15

  #### Parameters

  - ##### obj: any

  #### Returns obj is WithFaceLandmarks<{ detection: FaceDetection }, FaceLandmarks>

### isWithGender

- isWithGender(obj: any): obj is { gender: Gender; genderProbability: number }

- - Defined in factories/WithGender.ts:9

  #### Parameters

  - ##### obj: any

  #### Returns obj is { gender: Gender; genderProbability: number }

### Const loadAgeGenderModel

- loadAgeGenderModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:112

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadFaceDetectionModel

- loadFaceDetectionModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:115

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadFaceExpressionModel

- loadFaceExpressionModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:111

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadFaceLandmarkModel

- loadFaceLandmarkModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:108

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadFaceLandmarkTinyModel

- loadFaceLandmarkTinyModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:109

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadFaceRecognitionModel

- loadFaceRecognitionModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:110

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadSsdMobilenetv1Model

- loadSsdMobilenetv1Model(url: string): Promise<void>

- - Defined in globalApi/nets.ts:105

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadTinyFaceDetectorModel

- loadTinyFaceDetectorModel(url: string): Promise<void>

- - Defined in globalApi/nets.ts:106

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### Const loadTinyYolov2Model

- loadTinyYolov2Model(url: string): Promise<void>

- - Defined in globalApi/nets.ts:107

  #### Parameters

  - ##### url: string

  #### Returns Promise<void>

### loadWeightMap

- loadWeightMap(uri: string | undefined, defaultModelName: string): Promise<tf>

- - Defined in dom/loadWeightMap.ts:6

  #### Parameters

  - ##### uri: string | undefined

  - ##### defaultModelName: string

  #### Returns Promise<tf>

### Const locateFaces

- locateFaces(input: any, options: SsdMobilenetv1Options): Promise<FaceDetection[]>

- - Defined in globalApi/nets.ts:116

  #### Parameters

  - ##### input: any

  - ##### options: SsdMobilenetv1Options

  #### Returns Promise<FaceDetection[]>

### matchDimensions

- matchDimensions(input: IDimensions, reference: IDimensions, useMediaDimensions?: boolean): { height: number; width: number }

- - Defined in dom/matchDimensions.ts:4

  #### Parameters

  - ##### input: IDimensions

  - ##### reference: IDimensions

  - ##### useMediaDimensions: boolean = false

  #### Returns { height: number; width: number }

  - ##### height: number

  - ##### width: number

### minBbox

- minBbox(pts: IPoint[]): BoundingBox

- - Defined in ops/minBbox.ts:3

  #### Parameters

  - ##### pts: IPoint[]

  #### Returns BoundingBox

### nonMaxSuppression

- nonMaxSuppression(boxes: Box[], scores: number[], iouThreshold: number, isIOU?: boolean): number[]

- - Defined in ops/nonMaxSuppression.ts:4

  #### Parameters

  - ##### boxes: Box[]

  - ##### scores: number[]

  - ##### iouThreshold: number

  - ##### isIOU: boolean = true

  #### Returns number[]

### normalize

- normalize(x: tf, meanRgb: number[]): tf

- - Defined in ops/normalize.ts:3

  #### Parameters

  - ##### x: tf

  - ##### meanRgb: number[]

  #### Returns tf

### padToSquare

- padToSquare(imgTensor: tf, isCenterImage?: boolean): tf

- - Defined in ops/padToSquare.ts:11

  Pads the smaller dimension of an image tensor with zeros, such that width === height.

  #### Parameters

  - ##### imgTensor: tf

    The image tensor.

  - ##### isCenterImage: boolean = false

    (optional, default: false) If true, add an equal amount of padding on both sides of the minor dimension oof the image.

  #### Returns tf

  The padded tensor with width === height.

### Const predictAgeAndGender

- predictAgeAndGender(input: any): Promise<AgeAndGenderPrediction | AgeAndGenderPrediction[]>

- - Defined in globalApi/nets.ts:103

  Predicts age and gender from a face image.

  #### Parameters

  - ##### input: any

  #### Returns Promise<AgeAndGenderPrediction | AgeAndGenderPrediction[]>

  Predictions with age, gender and gender probability or array thereof in case of batch input.

### Const recognizeFaceExpressions

- recognizeFaceExpressions(input: any): Promise<FaceExpressions | FaceExpressions[]>

- - Defined in globalApi/nets.ts:94

  Recognizes the facial expressions from a face image.

  #### Parameters

  - ##### input: any

  #### Returns Promise<FaceExpressions | FaceExpressions[]>

  Facial expressions with corresponding probabilities or array thereof in case of batch input.

### resizeResults

- resizeResults<T>(results: T, dimensions: IDimensions): T

- - Defined in resizeResults.ts:7

  #### Type parameters

  - #### T

  #### Parameters

  - ##### results: T

  - ##### dimensions: IDimensions

  #### Returns T

### resolveInput

- resolveInput(arg: string | any): any

- - Defined in dom/resolveInput.ts:3

  #### Parameters

  - ##### arg: string | any

  #### Returns any

### shuffleArray

- shuffleArray(inputArray: any[]): any[]

- - Defined in ops/shuffleArray.ts:1

  #### Parameters

  - ##### inputArray: any[]

  #### Returns any[]

### sigmoid

- sigmoid(x: number): number

- - Defined in ops/index.ts:8

  #### Parameters

  - ##### x: number

  #### Returns number

### Const ssdMobilenetv1

- ssdMobilenetv1(input: any, options: SsdMobilenetv1Options): Promise<FaceDetection[]>

- - Defined in globalApi/nets.ts:35

  Attempts to detect all faces in an image using SSD Mobilenetv1 Network.

  #### Parameters

  - ##### input: any

    The input image.

  - ##### options: SsdMobilenetv1Options

    (optional, default: see SsdMobilenetv1Options constructor for default parameters).

  #### Returns Promise<FaceDetection[]>

  Bounding box of each face with score.

### tf

tf:

### Const tinyFaceDetector

- tinyFaceDetector(input: any, options: TinyFaceDetectorOptions): Promise<FaceDetection[]>

- - Defined in globalApi/nets.ts:44

  Attempts to detect all faces in an image using the Tiny Face Detector.

  #### Parameters

  - ##### input: any

    The input image.

  - ##### options: TinyFaceDetectorOptions

    (optional, default: see TinyFaceDetectorOptions constructor for default parameters).

  #### Returns Promise<FaceDetection[]>

  Bounding box of each face with score.

### Const tinyYolov2

- tinyYolov2(input: any, options: ITinyYolov2Options): Promise<FaceDetection[]>

- - Defined in globalApi/nets.ts:53

  Attempts to detect all faces in an image using the Tiny Yolov2 Network.

  #### Parameters

  - ##### input: any

    The input image.

  - ##### options: ITinyYolov2Options

    (optional, default: see TinyYolov2Options constructor for default parameters).

  #### Returns Promise<FaceDetection[]>

  Bounding box of each face with score.

### toNetInput

- toNetInput(inputs: TNetInput): Promise<NetInput>

- - Defined in dom/toNetInput.ts:15

  Validates the input to make sure, they are valid net inputs and awaits all media elements to be finished loading.

  #### Parameters

  - ##### inputs: TNetInput

  #### Returns Promise<NetInput>

  A NetInput instance, which can be passed into one of the neural networks.

### validateConfig

- validateConfig(config: any): void

- - Defined in tinyYolov2/config.ts:16

  #### Parameters

  - ##### config: any

  #### Returns void