Skip to content

Commit 5326863

Browse files
chmjkbmsluszniak
andauthored
Release v0.7.0 (#792)
## Description <!-- Provide a concise and descriptive summary of the changes implemented in this PR. --> ### Introduces a breaking change? - [ ] Yes - [ ] No ### Type of change - [ ] Bug fix (change which fixes an issue) - [ ] New feature (change which adds functionality) - [ ] Documentation update (improves or adds clarity to existing documentation) - [ ] Other (chores, tests, code style improvements etc.) ### Tested on - [ ] iOS - [ ] Android ### Testing instructions <!-- Provide step-by-step instructions on how to test your changes. Include setup details if necessary. --> ### Screenshots <!-- Add screenshots here, if applicable --> ### Related issues <!-- Link related issues here using #issue-number --> ### Checklist - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings ### Additional notes <!-- Include any additional information, assumptions, or context that reviewers might need to understand this PR. --> --------- Co-authored-by: Mateusz Słuszniak <mateusz.sluszniak@swmansion.com>
1 parent 180a40d commit 5326863

File tree

515 files changed

+15797
-709
lines changed

Some content is hidden

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

515 files changed

+15797
-709
lines changed

docs/docs/01-fundamentals/01-getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Getting Started
3-
slug: /
3+
slug: /fundamentals/getting-started
44
keywords:
55
[
66
react native,
@@ -94,7 +94,7 @@ yarn run expo:<ios | android> -d
9494

9595
Adding new functionality to the library follows a consistent three-step integration pipeline:
9696

97-
1. **Model Serialization:** We export PyTorch models for specific tasks (e.g., object detection) into the *.pte format, which is optimized for the ExecuTorch runtime.
97+
1. **Model Serialization:** We export PyTorch models for specific tasks (e.g., object detection) into the \*.pte format, which is optimized for the ExecuTorch runtime.
9898

9999
2. **Native Implementation:** We develop a C++ execution layer that interfaces with the ExecuTorch runtime to handle inference. This layer also manages model-dependent logic, such as data pre-processing and post-processing.
100100

@@ -106,4 +106,4 @@ If you want to dive deeper into ExecuTorch or our previous work with the framewo
106106

107107
- [ExecuTorch docs](https://pytorch.org/executorch/stable/index.html)
108108
- [React Native RAG](https://blog.swmansion.com/introducing-react-native-rag-fbb62efa4991)
109-
- [Offline Text Recognition on Mobile: How We Brought EasyOCR to React Native ExecuTorch](https://blog.swmansion.com/bringing-easyocr-to-react-native-executorch-2401c09c2d0c)
109+
- [Offline Text Recognition on Mobile: How We Brought EasyOCR to React Native ExecuTorch](https://blog.swmansion.com/bringing-easyocr-to-react-native-executorch-2401c09c2d0c)

docs/docs/03-hooks/03-executorch-bindings/useExecutorchModule.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ These bindings are primarily intended for custom model integration where no dedi
1010

1111
## API Reference
1212

13-
* For detailed API Reference for `useExecutorchModule` see: [`useExecutorchModule` API Reference](../../06-api-reference/functions/useExecutorchModule.md).
13+
- For detailed API Reference for `useExecutorchModule` see: [`useExecutorchModule` API Reference](../../06-api-reference/functions/useExecutorchModule.md).
1414

1515
## Initializing ExecuTorch Module
1616

@@ -31,16 +31,18 @@ For more information on loading resources, take a look at [loading models](../..
3131
### Arguments
3232

3333
`useExecutorchModule` takes [`ExecutorchModuleProps`](../../06-api-reference/interfaces/ExecutorchModuleProps.md) that consists of:
34-
* `model` containing [`modelSource`](../../06-api-reference/interfaces/ExecutorchModuleProps.md#modelsource).
35-
* An optional flag [`preventLoad`](../../06-api-reference/interfaces/ExecutorchModuleProps.md#preventload) which prevents auto-loading of the model.
34+
35+
- `model` containing [`modelSource`](../../06-api-reference/interfaces/ExecutorchModuleProps.md#modelsource).
36+
- An optional flag [`preventLoad`](../../06-api-reference/interfaces/ExecutorchModuleProps.md#preventload) which prevents auto-loading of the model.
3637

3738
You need more details? Check the following resources:
38-
* For detailed information about `useExecutorchModule` arguments check this section: [`useExecutorchModule` arguments](../../06-api-reference/functions/useExecutorchModule.md#parameters).
39-
* For more information on loading resources, take a look at [loading models](../../01-fundamentals/02-loading-models.md) page.
39+
40+
- For detailed information about `useExecutorchModule` arguments check this section: [`useExecutorchModule` arguments](../../06-api-reference/functions/useExecutorchModule.md#parameters).
41+
- For more information on loading resources, take a look at [loading models](../../01-fundamentals/02-loading-models.md) page.
4042

4143
### Returns
4244

43-
`useExecutorchModule` returns an object called `ExecutorchModuleType` containing bunch of functions to interact with arbitrarly chosen models. To get more details please read: [`ExecutorchModuleType` API Reference](../../06-api-reference/interfaces/ExecutorchModuleType.md).
45+
`useExecutorchModule` returns an object called `ExecutorchModuleType` containing bunch of functions to interact with arbitrarily chosen models. To get more details please read: [`ExecutorchModuleType` API Reference](../../06-api-reference/interfaces/ExecutorchModuleType.md).
4446

4547
## TensorPtr
4648

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Class: ClassificationModule
22

3-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L12)
3+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L12)
44

55
Module for image classification tasks.
66

@@ -28,7 +28,7 @@ Module for image classification tasks.
2828

2929
> **nativeModule**: `any` = `null`
3030
31-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
31+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
3232

3333
Native module instance
3434

@@ -42,7 +42,7 @@ Native module instance
4242

4343
> **delete**(): `void`
4444
45-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
45+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
4646

4747
Unloads the model from memory.
4848

@@ -60,7 +60,7 @@ Unloads the model from memory.
6060

6161
> **forward**(`imageSource`): `Promise`\<\{\[`category`: `string`\]: `number`; \}\>
6262
63-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:43](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L43)
63+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:43](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L43)
6464

6565
Executes the model's forward pass, where `imageSource` can be a fetchable resource or a Base64-encoded string.
6666

@@ -84,7 +84,7 @@ The classification result.
8484

8585
> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\>
8686
87-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
87+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
8888

8989
Runs the model's forward method with the given input tensors.
9090
It returns the output tensors that mimic the structure of output from ExecuTorch.
@@ -113,7 +113,7 @@ Array of output tensors.
113113

114114
> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\>
115115
116-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
116+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
117117

118118
Gets the input shape for a given method and index.
119119

@@ -147,7 +147,7 @@ The input shape as an array of numbers.
147147

148148
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
149149
150-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L20)
150+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts:20](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ClassificationModule.ts#L20)
151151

152152
Loads the model, where `modelSource` is a string that specifies the location of the model binary.
153153
To track the download progress, supply a callback function `onDownloadProgressCallback`.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Class: ExecutorchModule
22

3-
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L13)
3+
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:13](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L13)
44

55
General module for executing custom Executorch models.
66

@@ -28,7 +28,7 @@ General module for executing custom Executorch models.
2828

2929
> **nativeModule**: `any` = `null`
3030
31-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
31+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
3232

3333
Native module instance
3434

@@ -42,7 +42,7 @@ Native module instance
4242

4343
> **delete**(): `void`
4444
45-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
45+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
4646

4747
Unloads the model from memory.
4848

@@ -60,7 +60,7 @@ Unloads the model from memory.
6060

6161
> **forward**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\>
6262
63-
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:45](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L45)
63+
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:45](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L45)
6464

6565
Executes the model's forward pass, where input is an array of `TensorPtr` objects.
6666
If the inference is successful, an array of tensor pointers is returned.
@@ -85,7 +85,7 @@ An array of output tensor pointers.
8585

8686
> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\>
8787
88-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
88+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
8989

9090
Runs the model's forward method with the given input tensors.
9191
It returns the output tensors that mimic the structure of output from ExecuTorch.
@@ -114,7 +114,7 @@ Array of output tensors.
114114

115115
> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\>
116116
117-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
117+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
118118

119119
Gets the input shape for a given method and index.
120120

@@ -148,7 +148,7 @@ The input shape as an array of numbers.
148148

149149
> **load**(`modelSource`, `onDownloadProgressCallback`): `Promise`\<`void`\>
150150
151-
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L21)
151+
Defined in: [packages/react-native-executorch/src/modules/general/ExecutorchModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/general/ExecutorchModule.ts#L21)
152152

153153
Loads the model, where `modelSource` is a string, number, or object that specifies the location of the model binary.
154154
Optionally accepts a download progress callback.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Class: ImageEmbeddingsModule
22

3-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L12)
3+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:12](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L12)
44

55
Module for generating image embeddings from input images.
66

@@ -28,7 +28,7 @@ Module for generating image embeddings from input images.
2828

2929
> **nativeModule**: `any` = `null`
3030
31-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
31+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:8](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L8)
3232

3333
Native module instance
3434

@@ -42,7 +42,7 @@ Native module instance
4242

4343
> **delete**(): `void`
4444
45-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
45+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:41](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L41)
4646

4747
Unloads the model from memory.
4848

@@ -60,7 +60,7 @@ Unloads the model from memory.
6060

6161
> **forward**(`imageSource`): `Promise`\<`Float32Array`\<`ArrayBufferLike`\>\>
6262
63-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:42](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L42)
63+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:42](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L42)
6464

6565
Executes the model's forward pass. Returns an embedding array for a given sentence.
6666

@@ -84,7 +84,7 @@ A Float32Array containing the image embeddings.
8484

8585
> `protected` **forwardET**(`inputTensor`): `Promise`\<[`TensorPtr`](../interfaces/TensorPtr.md)[]\>
8686
87-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
87+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:23](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L23)
8888

8989
Runs the model's forward method with the given input tensors.
9090
It returns the output tensors that mimic the structure of output from ExecuTorch.
@@ -113,7 +113,7 @@ Array of output tensors.
113113

114114
> **getInputShape**(`methodName`, `index`): `Promise`\<`number`[]\>
115115
116-
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
116+
Defined in: [packages/react-native-executorch/src/modules/BaseModule.ts:34](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/BaseModule.ts#L34)
117117

118118
Gets the input shape for a given method and index.
119119

@@ -147,7 +147,7 @@ The input shape as an array of numbers.
147147

148148
> **load**(`model`, `onDownloadProgressCallback`): `Promise`\<`void`\>
149149
150-
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:19](https://github.com/software-mansion/react-native-executorch/blob/4ee3121e1a18c982703726f1f72421920ed523a4/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L19)
150+
Defined in: [packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts:19](https://github.com/software-mansion/react-native-executorch/blob/326d6344894d75625c600d5988666e215a32d466/packages/react-native-executorch/src/modules/computer_vision/ImageEmbeddingsModule.ts#L19)
151151

152152
Loads the model, where `modelSource` is a string that specifies the location of the model binary.
153153

0 commit comments

Comments
 (0)