Skip to content

Commit d0d7533

Browse files
committed
Update docs
1 parent 9bb42a4 commit d0d7533

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

apps/computer-vision/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
},
1313
"dependencies": {
1414
"@react-native-executorch/expo-resource-fetcher": "workspace:*",
15-
"@react-native-picker/picker": "^2.11.4",
1615
"@react-native/metro-config": "^0.81.5",
1716
"@react-navigation/drawer": "^7.8.1",
1817
"@react-navigation/native": "^7.1.28",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ try {
3636
`useInstanceSegmentation` takes [`InstanceSegmentationProps`](../../06-api-reference/interfaces/InstanceSegmentationProps.md) that consists of:
3737

3838
- `model` - An object containing:
39-
- `modelName` - The name of a built-in model. See [`InstanceSegmentationModelName`](../../06-api-reference/types/InstanceSegmentationModelName.md) for the list of supported models.
39+
- `modelName` - The name of a built-in model. See [`InstanceSegmentationModelName`](../../06-api-reference/type-aliases/InstanceSegmentationModelName.md) for the list of supported models.
4040
- `modelSource` - The location of the model binary (a URL or a bundled resource).
4141
- An optional flag [`preventLoad`](../../06-api-reference/interfaces/InstanceSegmentationProps.md#preventload) which prevents auto-loading of the model.
4242

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ TypeScript API implementation of the [useInstanceSegmentation](../../03-hooks/02
1111
## High Level Overview
1212

1313
```typescript
14-
import { InstanceSegmentationModule } from 'react-native-executorch';
14+
import {
15+
InstanceSegmentationModule,
16+
YOLO26N_SEG,
17+
} from 'react-native-executorch';
1518

1619
const imageUri = 'path/to/image.png';
1720

1821
// Creating an instance from a built-in model
19-
const segmentation = await InstanceSegmentationModule.fromModelName({
20-
modelName: 'yolo26n-seg',
21-
modelSource: 'https://huggingface.co/.../yolo26n-seg.pte',
22-
});
22+
const segmentation =
23+
await InstanceSegmentationModule.fromModelName(YOLO26N_SEG);
2324

2425
// Running the model
2526
const instances = await segmentation.forward(imageUri);
@@ -37,16 +38,19 @@ There are two ways to create an `InstanceSegmentationModule`:
3738

3839
Use [`fromModelName`](../../06-api-reference/classes/InstanceSegmentationModule.md#frommodelname) for pre-configured models. It accepts:
3940

40-
- `config` - An object containing:
41-
- `modelName` - The name of a built-in model (e.g. `'yolo26n-seg'`).
41+
- `config` - A model configuration object (e.g. `YOLO26N_SEG`, `YOLO26S_SEG`) imported from the library, containing:
42+
- `modelName` - The name of a built-in model.
4243
- `modelSource` - Location of the model binary (a URL or a bundled resource).
4344
- `onDownloadProgress` (optional) - Callback to track download progress, receiving a value between 0 and 1.
4445

4546
```typescript
46-
const segmentation = await InstanceSegmentationModule.fromModelName({
47-
modelName: 'yolo26n-seg',
48-
modelSource: 'https://huggingface.co/.../yolo26n-seg.pte',
49-
});
47+
import {
48+
InstanceSegmentationModule,
49+
YOLO26N_SEG,
50+
} from 'react-native-executorch';
51+
52+
const segmentation =
53+
await InstanceSegmentationModule.fromModelName(YOLO26N_SEG);
5054
```
5155

5256
### From a custom config
@@ -60,7 +64,8 @@ Use [`fromCustomConfig`](../../06-api-reference/classes/InstanceSegmentationModu
6064
- `postprocessorConfig` (optional) - Postprocessing settings (`applyNMS`).
6165
- `defaultConfidenceThreshold` (optional) - Default confidence threshold.
6266
- `defaultIouThreshold` (optional) - Default IoU threshold.
63-
- `availableInputSizes` and `defaultInputSize` - **Required** if your model supports multiple input sizes (i.e., exports multiple forward methods like `forward_384`, `forward_512`, `forward_640`). Both must be specified together or omitted together.
67+
- `availableInputSizes` (optional) - Array of supported input sizes (e.g., `[384, 512, 640]`). **Required** if your model exports multiple forward methods.
68+
- `defaultInputSize` (optional) - The input size to use when `options.inputSize` is not provided. **Required** if `availableInputSizes` is specified.
6469
- `onDownloadProgress` (optional) - Callback to track download progress.
6570

6671
:::tip

0 commit comments

Comments
 (0)