Skip to main content
Version: Next

Function: useObjectDetection()

useObjectDetection<C>(props): ObjectDetectionType<ObjectDetectionLabels<C["modelName"]>>

Defined in: hooks/computer_vision/useObjectDetection.ts:22

React hook for managing an Object Detection model instance.

Type Parameters

C

C extends ObjectDetectionModelSources

A ObjectDetectionModelSources config specifying which built-in model to load.

Parameters

props

ObjectDetectionProps<C>

Configuration object containing model config and optional preventLoad flag.

Returns

ObjectDetectionType<ObjectDetectionLabels<C["modelName"]>>

An object with model state (error, isReady, isGenerating, downloadProgress) and typed forward and runOnFrame functions.