Skip to main content
Version: 0.10.0

Function: createKeypointDetector()

createKeypointDetector<F, L>(config, runtime?): Promise<KeypointDetector<F, L>>

Defined in: extensions/cv/tasks/keypointDetection.ts:227

Creates an image keypoint detector runner for executing local Keypoint/Pose Detection models.

It validates model inputs and output shapes (bounding boxes, confidence scores, and landmark coordinates), pre-allocates execution tensors, setups preprocessing, and sets up lifecycle disposals.

Type Parameters

F

F extends "xyxy" | "xywh" | "cxcywh"

The bounding box format.

L

L extends PropertyKey

The landmark labels type.

Parameters

config

KeypointDetectorModel<F, L>

Keypoint task configuration containing path and options. See KeypointDetectorModel.

runtime?

any

Optional worklet runtime thread on which to run the model execution.

Returns

Promise<KeypointDetector<F, L>>

A promise resolving to the instantiated KeypointDetector runner.

Throws

With code LOAD_FAILED if model fails to load, or SCHEMA_MISMATCH if model schema does not match keypoint detection spec.