Skip to content

Commit 53dde26

Browse files
Merge branch 'main' into @ml/configure-eslint-jsdoc-plugin
2 parents 2c1cb5e + 2b6ea20 commit 53dde26

41 files changed

Lines changed: 407 additions & 82 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell-wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,5 @@ antonov
116116
rfdetr
117117
basemodule
118118
IMAGENET
119+
lraspp
120+
LRASPP

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ function App() {
117117

118118
## Supported models
119119

120-
| Model | Number of classes | Class list |
121-
| ------------------------------------------------------------------------------------------------ | ----------------- | ----------------------------------------------------------------------------------------- |
122-
| [deeplabv3_resnet50](https://huggingface.co/software-mansion/react-native-executorch-deeplab-v3) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) |
123-
| selfie-segmentation | 2 | [SelfieSegmentationLabel](../../06-api-reference/enumerations/SelfieSegmentationLabel.md) |
120+
| Model | Number of classes | Class list | Quantized |
121+
| ----------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------- | :-------: |
122+
| [deeplab-v3-resnet50](https://huggingface.co/software-mansion/react-native-executorch-deeplab-v3) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
123+
| [deeplab-v3-resnet101](https://huggingface.co/software-mansion/react-native-executorch-deeplab-v3) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
124+
| [deeplab-v3-mobilenet-v3-large](https://huggingface.co/software-mansion/react-native-executorch-deeplab-v3) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
125+
| [lraspp-mobilenet-v3-large](https://huggingface.co/software-mansion/react-native-executorch-lraspp) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
126+
| [fcn-resnet50](https://huggingface.co/software-mansion/react-native-executorch-fcn) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
127+
| [fcn-resnet101](https://huggingface.co/software-mansion/react-native-executorch-fcn) | 21 | [DeeplabLabel](../../06-api-reference/enumerations/DeeplabLabel.md) | Yes |
128+
| [selfie-segmentation](https://huggingface.co/software-mansion/react-native-executorch-selfie-segmentation) | 2 | [SelfieSegmentationLabel](../../06-api-reference/enumerations/SelfieSegmentationLabel.md) | No |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const segmentation = await SemanticSegmentationModule.fromModelName(
4949
);
5050
```
5151

52-
The `config` parameter is a discriminated union — TypeScript ensures you provide the correct fields for each model name. Available built-in models: `'deeplab-v3'`, `'selfie-segmentation'`.
52+
The `config` parameter is a discriminated union — TypeScript ensures you provide the correct fields for each model name. Available built-in models: `'deeplab-v3-resnet50'`, `'deeplab-v3-resnet50-quantized'`, `'deeplab-v3-resnet101'`, `'deeplab-v3-resnet101-quantized'`, `'deeplab-v3-mobilenet-v3-large'`, `'deeplab-v3-mobilenet-v3-large-quantized'`, `'lraspp-mobilenet-v3-large'`, `'lraspp-mobilenet-v3-large-quantized'`, `'fcn-resnet50'`, `'fcn-resnet50-quantized'`, `'fcn-resnet101'`, `'fcn-resnet101-quantized'`, and `'selfie-segmentation'`.
5353

5454
### Custom models — `fromCustomConfig`
5555

docs/docs/06-api-reference/classes/SemanticSegmentationModule.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Class: SemanticSegmentationModule\<T\>
22

3-
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:59](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L59)
3+
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:79](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L79)
44

55
Generic semantic segmentation module with type-safe label maps.
6-
Use a model name (e.g. `'deeplab-v3'`) as the generic parameter for built-in models,
6+
Use a model name (e.g. `'deeplab-v3-resnet50'`) as the generic parameter for built-in models,
77
or a custom label enum for custom configs.
88

99
## Extends
@@ -16,8 +16,13 @@ or a custom label enum for custom configs.
1616

1717
`T` _extends_ [`SemanticSegmentationModelName`](../type-aliases/SemanticSegmentationModelName.md) \| [`LabelEnum`](../type-aliases/LabelEnum.md)
1818

19-
Either a built-in model name (`'deeplab-v3'`, `'selfie-segmentation'`)
20-
or a custom [LabelEnum](../type-aliases/LabelEnum.md) label map.
19+
Either a built-in model name (`'deeplab-v3-resnet50'`,
20+
`'deeplab-v3-resnet50-quantized'`, `'deeplab-v3-resnet101'`,
21+
`'deeplab-v3-resnet101-quantized'`, `'deeplab-v3-mobilenet-v3-large'`,
22+
`'deeplab-v3-mobilenet-v3-large-quantized'`, `'lraspp-mobilenet-v3-large'`,
23+
`'lraspp-mobilenet-v3-large-quantized'`, `'fcn-resnet50'`,
24+
`'fcn-resnet50-quantized'`, `'fcn-resnet101'`, `'fcn-resnet101-quantized'`,
25+
`'selfie-segmentation'`) or a custom [LabelEnum](../type-aliases/LabelEnum.md) label map.
2126

2227
## Properties
2328

@@ -57,7 +62,7 @@ Unloads the model from memory.
5762

5863
> **forward**\<`K`\>(`imageSource`, `classesOfInterest?`, `resizeToInput?`): `Promise`\<`Record`\<`"ARGMAX"`, `Int32Array`\<`ArrayBufferLike`\>\> & `Record`\<`K`, `Float32Array`\<`ArrayBufferLike`\>\>\>
5964
60-
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:173](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L173)
65+
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:190](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L190)
6166

6267
Executes the model's forward pass to perform semantic segmentation on the provided image.
6368

@@ -166,7 +171,7 @@ The input shape as an array of numbers.
166171

167172
> **load**(): `Promise`\<`void`\>
168173
169-
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:75](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L75)
174+
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:95](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L95)
170175

171176
#### Returns
172177

@@ -182,7 +187,7 @@ Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:75](https://g
182187

183188
> `static` **fromCustomConfig**\<`L`\>(`modelSource`, `config`, `onDownloadProgress?`): `Promise`\<`SemanticSegmentationModule`\<`L`\>\>
184189
185-
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:140](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L140)
190+
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:157](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L157)
186191

187192
Creates a segmentation instance with a user-provided label map and custom config.
188193
Use this when working with a custom-exported segmentation model that is not one of the built-in models.
@@ -235,7 +240,7 @@ const segmentation = await SemanticSegmentationModule.fromCustomConfig(
235240

236241
> `static` **fromModelName**\<`C`\>(`config`, `onDownloadProgress?`): `Promise`\<`SemanticSegmentationModule`\<[`ModelNameOf`](../type-aliases/ModelNameOf.md)\<`C`\>\>\>
237242
238-
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:94](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L94)
243+
Defined in: [modules/computer_vision/SemanticSegmentationModule.ts:112](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/computer_vision/SemanticSegmentationModule.ts#L112)
239244

240245
Creates a segmentation instance for a built-in model.
241246
The config object is discriminated by `modelName` — each model can require different fields.
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enumeration: DeeplabLabel
22

3-
Defined in: [types/semanticSegmentation.ts:50](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L50)
3+
Defined in: [types/semanticSegmentation.ts:65](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L65)
44

55
Labels used in the DeepLab semantic segmentation model.
66

@@ -10,164 +10,164 @@ Labels used in the DeepLab semantic segmentation model.
1010

1111
> **AEROPLANE**: `1`
1212
13-
Defined in: [types/semanticSegmentation.ts:52](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L52)
13+
Defined in: [types/semanticSegmentation.ts:67](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L67)
1414

1515
---
1616

1717
### BACKGROUND
1818

1919
> **BACKGROUND**: `0`
2020
21-
Defined in: [types/semanticSegmentation.ts:51](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L51)
21+
Defined in: [types/semanticSegmentation.ts:66](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L66)
2222

2323
---
2424

2525
### BICYCLE
2626

2727
> **BICYCLE**: `2`
2828
29-
Defined in: [types/semanticSegmentation.ts:53](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L53)
29+
Defined in: [types/semanticSegmentation.ts:68](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L68)
3030

3131
---
3232

3333
### BIRD
3434

3535
> **BIRD**: `3`
3636
37-
Defined in: [types/semanticSegmentation.ts:54](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L54)
37+
Defined in: [types/semanticSegmentation.ts:69](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L69)
3838

3939
---
4040

4141
### BOAT
4242

4343
> **BOAT**: `4`
4444
45-
Defined in: [types/semanticSegmentation.ts:55](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L55)
45+
Defined in: [types/semanticSegmentation.ts:70](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L70)
4646

4747
---
4848

4949
### BOTTLE
5050

5151
> **BOTTLE**: `5`
5252
53-
Defined in: [types/semanticSegmentation.ts:56](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L56)
53+
Defined in: [types/semanticSegmentation.ts:71](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L71)
5454

5555
---
5656

5757
### BUS
5858

5959
> **BUS**: `6`
6060
61-
Defined in: [types/semanticSegmentation.ts:57](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L57)
61+
Defined in: [types/semanticSegmentation.ts:72](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L72)
6262

6363
---
6464

6565
### CAR
6666

6767
> **CAR**: `7`
6868
69-
Defined in: [types/semanticSegmentation.ts:58](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L58)
69+
Defined in: [types/semanticSegmentation.ts:73](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L73)
7070

7171
---
7272

7373
### CAT
7474

7575
> **CAT**: `8`
7676
77-
Defined in: [types/semanticSegmentation.ts:59](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L59)
77+
Defined in: [types/semanticSegmentation.ts:74](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L74)
7878

7979
---
8080

8181
### CHAIR
8282

8383
> **CHAIR**: `9`
8484
85-
Defined in: [types/semanticSegmentation.ts:60](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L60)
85+
Defined in: [types/semanticSegmentation.ts:75](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L75)
8686

8787
---
8888

8989
### COW
9090

9191
> **COW**: `10`
9292
93-
Defined in: [types/semanticSegmentation.ts:61](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L61)
93+
Defined in: [types/semanticSegmentation.ts:76](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L76)
9494

9595
---
9696

9797
### DININGTABLE
9898

9999
> **DININGTABLE**: `11`
100100
101-
Defined in: [types/semanticSegmentation.ts:62](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L62)
101+
Defined in: [types/semanticSegmentation.ts:77](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L77)
102102

103103
---
104104

105105
### DOG
106106

107107
> **DOG**: `12`
108108
109-
Defined in: [types/semanticSegmentation.ts:63](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L63)
109+
Defined in: [types/semanticSegmentation.ts:78](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L78)
110110

111111
---
112112

113113
### HORSE
114114

115115
> **HORSE**: `13`
116116
117-
Defined in: [types/semanticSegmentation.ts:64](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L64)
117+
Defined in: [types/semanticSegmentation.ts:79](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L79)
118118

119119
---
120120

121121
### MOTORBIKE
122122

123123
> **MOTORBIKE**: `14`
124124
125-
Defined in: [types/semanticSegmentation.ts:65](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L65)
125+
Defined in: [types/semanticSegmentation.ts:80](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L80)
126126

127127
---
128128

129129
### PERSON
130130

131131
> **PERSON**: `15`
132132
133-
Defined in: [types/semanticSegmentation.ts:66](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L66)
133+
Defined in: [types/semanticSegmentation.ts:81](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L81)
134134

135135
---
136136

137137
### POTTEDPLANT
138138

139139
> **POTTEDPLANT**: `16`
140140
141-
Defined in: [types/semanticSegmentation.ts:67](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L67)
141+
Defined in: [types/semanticSegmentation.ts:82](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L82)
142142

143143
---
144144

145145
### SHEEP
146146

147147
> **SHEEP**: `17`
148148
149-
Defined in: [types/semanticSegmentation.ts:68](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L68)
149+
Defined in: [types/semanticSegmentation.ts:83](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L83)
150150

151151
---
152152

153153
### SOFA
154154

155155
> **SOFA**: `18`
156156
157-
Defined in: [types/semanticSegmentation.ts:69](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L69)
157+
Defined in: [types/semanticSegmentation.ts:84](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L84)
158158

159159
---
160160

161161
### TRAIN
162162

163163
> **TRAIN**: `19`
164164
165-
Defined in: [types/semanticSegmentation.ts:70](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L70)
165+
Defined in: [types/semanticSegmentation.ts:85](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L85)
166166

167167
---
168168

169169
### TVMONITOR
170170

171171
> **TVMONITOR**: `20`
172172
173-
Defined in: [types/semanticSegmentation.ts:71](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L71)
173+
Defined in: [types/semanticSegmentation.ts:86](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L86)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enumeration: SelfieSegmentationLabel
22

3-
Defined in: [types/semanticSegmentation.ts:79](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L79)
3+
Defined in: [types/semanticSegmentation.ts:93](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L93)
44

55
Labels used in the selfie semantic segmentation model.
66

@@ -10,12 +10,12 @@ Labels used in the selfie semantic segmentation model.
1010

1111
> **BACKGROUND**: `1`
1212
13-
Defined in: [types/semanticSegmentation.ts:81](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L81)
13+
Defined in: [types/semanticSegmentation.ts:95](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L95)
1414

1515
---
1616

1717
### SELFIE
1818

1919
> **SELFIE**: `0`
2020
21-
Defined in: [types/semanticSegmentation.ts:80](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L80)
21+
Defined in: [types/semanticSegmentation.ts:94](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/semanticSegmentation.ts#L94)

0 commit comments

Comments
 (0)