useKeypointDetector<
F,L>(config,options?):object
Defined in: hooks/useKeypointDetector.ts:28
React hook to load and run a keypoint detection model.
This hook manages downloading (if remote URLs are provided) and loading the model assets, compiling them, tracking download progress and load errors, and releasing native memory when the component unmounts or the configuration changes.
For imperative usage, see createKeypointDetector.
F extends "xyxy" | "xywh" | "cxcywh"
The bounding box format.
L extends PropertyKey
The landmark labels type.
KeypointDetectorModel<F, L>
The keypoint detection model configuration. See KeypointDetectorModel.
Load and caching options. See ResourceOptions.
object
The same object as KeypointDetector (without dispose),
combined with loading state, download progress, and landmarks.
detectKeypoints: (
input,options?) =>Promise<KeypointDetection<F,L>[]> |undefined=model.detectKeypoints
detectKeypointsWorklet: (
input,options?) =>KeypointDetection<F,L>[] |undefined=model.detectKeypointsWorklet
downloadProgress:
number
error:
Error|undefined
isReady:
boolean=!!model
landmarks: readonly
L[] =config.modelOpts.landmarks
resource:
KeypointDetectorModel<F,L> |undefined