Skip to content

Commit b22762e

Browse files
committed
docs: update docs
1 parent 3e9bb2f commit b22762e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

docs/docs/03-hooks/02-computer-vision/usePoseEstimation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,18 @@ To run the model, use the [`forward`](../../06-api-reference/interfaces/PoseEsti
6868
- `input` (required) - The image to process. Can be a remote URL, a local file URI, a base64-encoded image (whole URI or only raw base64), or a [`PixelData`](../../06-api-reference/interfaces/PixelData.md) object (raw RGB pixel buffer).
6969
- `options` (optional) - A [`PoseEstimationOptions`](../../06-api-reference/interfaces/PoseEstimationOptions.md) object with the following properties:
7070
- `detectionThreshold` (optional) - A number between 0 and 1 representing the minimum confidence score for a detected person. Defaults to model-specific value (typically `0.5`).
71-
- `iouThreshold` (optional) - IoU threshold for non-maximum suppression (0-1). Defaults to model-specific value (typically `0.5`).
71+
- `keypointThreshold` (optional) - Per-keypoint visibility threshold (0-1). Keypoints whose model-reported visibility falls below this are emitted as `(-1, -1)` so consumers can skip them. Defaults to model-specific value.
7272
- `inputSize` (optional) - For multi-method models like YOLO, specify the input resolution (`384`, `512`, or `640`). Defaults to `384` for YOLO models.
7373

7474
`forward` returns a promise resolving to an array of [`PersonKeypoints`](../../06-api-reference/type-aliases/PersonKeypoints.md) — one entry per detected person. Each entry is an object keyed by the model's keypoint names (typed against the model's keypoint map), where each value is a [`Keypoint`](../../06-api-reference/interfaces/Keypoint.md) with:
7575

7676
- `x` - The x coordinate in the original image's pixel space.
7777
- `y` - The y coordinate in the original image's pixel space.
7878

79+
:::info
80+
Keypoints whose visibility falls below `keypointThreshold` (or that the model considers off-image) are returned as `{ x: -1, y: -1 }`. Filter them out before drawing — e.g. `if (kp.x < 0 || kp.y < 0) skip;`.
81+
:::
82+
7983
For example, with a COCO-keypoint model:
8084

8185
```typescript

docs/docs/04-typescript-api/02-computer-vision/PoseEstimationModule.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ To run the model, use the [`forward`](../../06-api-reference/classes/PoseEstimat
4242
- `input` (required) - The image to process. Can be a remote URL, a local file URI, a base64-encoded image (whole URI or only raw base64), or a [`PixelData`](../../06-api-reference/interfaces/PixelData.md) object (raw RGB pixel buffer).
4343
- `options` (optional) - A [`PoseEstimationOptions`](../../06-api-reference/interfaces/PoseEstimationOptions.md) object with:
4444
- `detectionThreshold` (optional) - Minimum confidence score for a detected person (0-1). Defaults to model-specific value.
45-
- `iouThreshold` (optional) - IoU threshold for NMS (0-1). Defaults to model-specific value.
45+
- `keypointThreshold` (optional) - Per-keypoint visibility threshold (0-1). Keypoints whose model-reported visibility falls below this are reported as `(-1, -1)` so consumers can skip them. Defaults to model-specific value.
4646
- `inputSize` (optional) - For YOLO models: `384`, `512`, or `640`. Defaults to `384`.
4747

4848
The method returns a promise resolving to an array of [`PersonKeypoints`](../../06-api-reference/type-aliases/PersonKeypoints.md). Each entry is an object keyed by the model's keypoint names (e.g. `NOSE`, `LEFT_SHOULDER`), where each value is a [`Keypoint`](../../06-api-reference/interfaces/Keypoint.md) with `x` and `y` coordinates in the original image's pixel space.
4949

50+
:::info
51+
Keypoints whose visibility falls below `keypointThreshold` (or that the model considers off-image) are returned as `{ x: -1, y: -1 }`. Filter them out before drawing — e.g. `if (kp.x < 0 || kp.y < 0) skip;`.
52+
:::
53+
5054
For real-time frame processing, use [`runOnFrame`](../../03-hooks/02-computer-vision/visioncamera-integration.md) instead.
5155

5256
### Example with Options

0 commit comments

Comments
 (0)