Skip to content

Commit c26e30d

Browse files
committed
docs: Add fixes in docs section
1 parent e3f886d commit c26e30d

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ For more information on loading resources, take a look at [loading models](../..
5353
- `error` - An error object if the model failed to load or encountered a runtime error.
5454
- `downloadProgress` - A value between 0 and 1 representing the download progress of the model binary.
5555
- `forward` - A function to run inference on an image.
56+
- `getAvailableInputSizes` - Returns the available input sizes for the loaded model, or `undefined` if the model accepts only a single input size. Use this to populate UI controls for selecting the input resolution.
57+
- `runOnFrame` - A synchronous worklet function for real-time VisionCamera frame processing. Returns `null` until the model is ready. See [VisionCamera Integration](./visioncamera-integration.md) for usage.
5658

5759
## Running the model
5860

packages/react-native-executorch/src/hooks/computer_vision/useInstanceSegmentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import { useModuleFactory } from '../useModuleFactory';
1313
* React hook for managing an Instance Segmentation model instance.
1414
* @typeParam C - A {@link InstanceSegmentationModelSources} config specifying which model to load.
1515
* @param props - Configuration object containing `model` config and optional `preventLoad` flag.
16-
* @returns An object with model state (`error`, `isReady`, `isGenerating`, `downloadProgress`) and a typed `forward` function.
16+
* @returns An object with model state (`error`, `isReady`, `isGenerating`, `downloadProgress`), a typed `forward` function, `getAvailableInputSizes` helper, and a `runOnFrame` worklet for VisionCamera integration.
1717
* @example
1818
* ```ts
19-
* const { isReady, isGenerating, forward, error, downloadProgress } =
19+
* const { isReady, isGenerating, forward, error, downloadProgress, getAvailableInputSizes, runOnFrame } =
2020
* useInstanceSegmentation({
2121
* model: {
2222
* modelName: 'yolo26n-seg',

packages/react-native-executorch/src/types/instanceSegmentation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ export interface InstanceSegmentationType<L extends LabelEnum> {
196196
* **Use this for VisionCamera frame processing in worklets.**
197197
* For async processing, use `forward()` instead.
198198
*
199-
* Available after model is loaded (`isReady: true`).
199+
* `null` until the model is ready (`isReady: true`). The property itself is
200+
* `null` when the model has not loaded yet — the function always returns an
201+
* array (never `null`) once called.
200202
* @param frame - VisionCamera Frame object
201203
* @param isFrontCamera - Whether the front camera is active (for mirroring correction).
202204
* @param options - Optional configuration for the segmentation process.

packages/react-native-executorch/src/types/objectDetection.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export { CocoLabel };
66
/**
77
* Represents a bounding box for a detected object in an image.
88
* @category Types
9-
* @property {number} x1 - The x-coordinate of the bottom-left corner of the bounding box.
10-
* @property {number} y1 - The y-coordinate of the bottom-left corner of the bounding box.
11-
* @property {number} x2 - The x-coordinate of the top-right corner of the bounding box.
12-
* @property {number} y2 - The y-coordinate of the top-right corner of the bounding box.
9+
* @property {number} x1 - The x-coordinate of the top-left corner of the bounding box.
10+
* @property {number} y1 - The y-coordinate of the top-left corner of the bounding box.
11+
* @property {number} x2 - The x-coordinate of the bottom-right corner of the bounding box.
12+
* @property {number} y2 - The y-coordinate of the bottom-right corner of the bounding box.
1313
*/
1414
export interface Bbox {
1515
x1: number;

0 commit comments

Comments
 (0)