Skip to content

Commit 421dc36

Browse files
authored
docs: fixed docs useImageEmbeddings (#519)
## 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. -->
1 parent 40718e8 commit 421dc36

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/docs/02-hooks/02-computer-vision/useImageEmbeddings.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ For more information on loading resources, take a look at [loading models](../..
5151

5252
### Returns
5353

54-
| Field | Type | Description |
55-
| ------------------ | ------------------------------------------- | --------------------------------------------------------------------------------------------- |
56-
| `forward` | `(input: imageSource) => Promise<number[]>` | Executes the model's forward pass, where `input` is a URI/URL to image that will be embedded. |
57-
| `error` | <code>string &#124; null</code> | Contains the error message if the model failed to load. |
58-
| `isGenerating` | `boolean` | Indicates whether the model is currently processing an inference. |
59-
| `isReady` | `boolean` | Indicates whether the model has successfully loaded and is ready for inference. |
60-
| `downloadProgress` | `number` | Represents the download progress as a value between 0 and 1. |
54+
| Field | Type | Description |
55+
| ------------------ | ----------------------------------------------- | --------------------------------------------------------------------------------------------- |
56+
| `forward` | `(input: imageSource) => Promise<Float32Array>` | Executes the model's forward pass, where `input` is a URI/URL to image that will be embedded. |
57+
| `error` | <code>string &#124; null</code> | Contains the error message if the model failed to load. |
58+
| `isGenerating` | `boolean` | Indicates whether the model is currently processing an inference. |
59+
| `isReady` | `boolean` | Indicates whether the model has successfully loaded and is ready for inference. |
60+
| `downloadProgress` | `number` | Represents the download progress as a value between 0 and 1. |
6161

6262
## Running the model
6363

@@ -66,10 +66,10 @@ To run the model, you can use the `forward` method. It accepts one argument whic
6666
## Example
6767

6868
```typescript
69-
const dotProduct = (a: number[], b: number[]) =>
69+
const dotProduct = (a: Float32Array, b: Float32Array) =>
7070
a.reduce((sum, val, i) => sum + val * b[i], 0);
7171

72-
const cosineSimilarity = (a: number[], b: number[]) => {
72+
const cosineSimilarity = (a: Float32Array, b: Float32Array) => {
7373
const dot = dotProduct(a, b);
7474
const normA = Math.sqrt(dotProduct(a, a));
7575
const normB = Math.sqrt(dotProduct(b, b));

0 commit comments

Comments
 (0)