You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/docs/computer-vision/useClassification.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Usually, the class with the highest probability is the one that is assigned to a
10
10
:::
11
11
12
12
:::caution
13
-
It is recommended to use models provided by us, which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s). You can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library
13
+
It is recommended to use models provided by us, which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-efficientnet-v2-s). You can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library.
Copy file name to clipboardexpand all lines: docs/docs/computer-vision/useImageSegmentation.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@ title: useImageSegmentation
3
3
sidebar_position: 2
4
4
---
5
5
6
-
Semantic image segmentation, akin to image classification, tries to assign the content of the image to one of the predefined classes. However, in case of segmentation this classification is done on a per-pixel basis, so as the result the model provides an image-sized array of scores for each of the classes. React Native ExecuTorch offers a dedicated hook `useImageSegmentation` for this task. However, before you start you'll need to obtain ExecuTorch-compatible model binary.
6
+
Semantic image segmentation, akin to image classification, tries to assign the content of the image to one of the predefined classes. However, in case of segmentation this classification is done on a per-pixel basis, so as the result the model provides an image-sized array of scores for each of the classes. You can then use this information to detect objects on a per-pixel basis. React Native ExecuTorch offers a dedicated hook `useImageSegmentation` for this task.
7
7
8
8
:::caution
9
-
It is recommended to use models provided by us which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy), you can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library
9
+
It is recommended to use models provided by us which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy), you can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library.
10
10
:::
11
11
12
12
## Reference
@@ -37,13 +37,13 @@ A string that specifies the location of the model binary. For more information,
|`forward`|`(input: string, classesOfInterest?: DeeplabLabel[], resize?: boolean) => Promise<{[key in DeeplabLabel]?: number[]}>`| Executes the model's forward pass, where: <br> \*`input` can be a fetchable resource or a Base64-encoded string. <br> \*`classesOfInterest` is an optional list of `DeeplabLabel` used to indicate additional arrays of probabilities to output (see section "Running the model"). The default is an empty list. <br> \*`resize` is an optional boolean to indicate whether the output should be resized to the original image dimensions, or left in the size of the model (see section "Running the model"). The default is `false`. <br> <br> The return is a dictionary containing: <br> \* for the key `DeeplabLabel.ARGMAX` an array of integers corresponding to the most probable class for each pixel <br> \* an array of floats for each class from `classesOfInterest` corresponding to the probabilities for this class. |
43
-
|`error`| <code>string | null</code> | Contains the error message if the model failed to load. |
44
-
|`isGenerating`|`boolean`| Indicates whether the model is currently processing an inference. |
45
-
|`isReady`|`boolean`| Indicates whether the model has successfully loaded and is ready for inference. |
46
-
|`downloadProgress`|`number`| Represents the download progress as a value between 0 and 1. |
|`forward`|`(input: string, classesOfInterest?: DeeplabLabel[], resize?: boolean) => Promise<{[key in DeeplabLabel]?: number[]}>`| Executes the model's forward pass, where: <br/> \*`input` can be a fetchable resource or a Base64-encoded string. <br/> \*`classesOfInterest` is an optional list of `DeeplabLabel` used to indicate additional arrays of probabilities to output (see section "Running the model"). The default is an empty list. <br/> \*`resize` is an optional boolean to indicate whether the output should be resized to the original image dimensions, or left in the size of the model (see section "Running the model"). The default is `false`. <br/> <br/> The return is a dictionary containing: <br/> \* for the key `DeeplabLabel.ARGMAX` an array of integers corresponding to the most probable class for each pixel <br/> \* an array of floats for each class from `classesOfInterest` corresponding to the probabilities for this class. |
43
+
|`error`| <code>string | null</code> | Contains the error message if the model failed to load. |
44
+
|`isGenerating`|`boolean`| Indicates whether the model is currently processing an inference. |
45
+
|`isReady`|`boolean`| Indicates whether the model has successfully loaded and is ready for inference. |
46
+
|`downloadProgress`|`number`| Represents the download progress as a value between 0 and 1. |
47
47
48
48
## Running the model
49
49
@@ -54,7 +54,7 @@ To run the model, you can use the `forward` method. It accepts three arguments:
54
54
- The `resize` flag says whether the output will be rescaled back to the size of the image you put in. The default is `false`. The model runs inference on a scaled (probably smaller) version of your image (224x224 for `DEEPLABV3_RESNET50`). If you choose to resize, the output will be `number[]` of size `width * height` of your original image.
55
55
56
56
:::caution
57
-
Setting `resize` to true will make `forward` slower
57
+
Setting `resize` to true will make `forward` slower.
58
58
:::
59
59
60
60
`forward` returns a promise which can resolve either to an error or a dictionary containing number arrays with size depending on `resize`:
Copy file name to clipboardexpand all lines: docs/docs/computer-vision/useStyleTransfer.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ sidebar_position: 2
6
6
Style transfer is a technique used in computer graphics and machine learning where the visual style of one image is applied to the content of another. This is achieved using algorithms that manipulate data from both images, typically with the aid of a neural network. The result is a new image that combines the artistic elements of one picture with the structural details of another, effectively merging art with traditional imagery. React Native ExecuTorch offers a dedicated hook `useStyleTransfer`, for this task. However before you start you'll need to obtain ExecuTorch-compatible model binary.
7
7
8
8
:::caution
9
-
It is recommended to use models provided by us which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy), you can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library
9
+
It is recommended to use models provided by us which are available at our [Hugging Face repository](https://huggingface.co/software-mansion/react-native-executorch-style-transfer-candy), you can also use [constants](https://github.com/software-mansion/react-native-executorch/tree/main/src/constants/modelUrls.ts) shipped with our library.
0 commit comments