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
|`transcribe`|`(waveform: Float32Array \| number[], options?: DecodingOptions \| undefined) => Promise<string>`| Starts a transcription process for a given input array, which should be a waveform at 16kHz. The second argument is an options object, e.g. `{ language: 'es' }` for multilingual models. Resolves a promise with the output transcription when the model is finished. Passing `number[]` is deprecated. |
81
-
|`stream`|`(options?: DecodingOptions \| undefined) => Promise<string>`| Starts a streaming transcription process. Use in combination with `streamInsert` to feed audio chunks and `streamStop` to end the stream. The argument is an options object, e.g. `{ language: 'es' }` for multilingual models. Updates `committedTranscription` and `nonCommittedTranscription` as transcription progresses.|
82
-
|`streamInsert`|`(waveform: Float32Array \| number[]) => void`| Inserts a chunk of audio data (sampled at 16kHz) into the ongoing streaming transcription. Call this repeatedly as new audio data becomes available. Passing `number[]` is deprecated. |
83
-
|`streamStop`|`() => void`| Stops the ongoing streaming transcription process. |
84
-
|`encode`|`(waveform: Float32Array \| number[]) => Promise<Float32Array>`| Runs the encoding part of the model on the provided waveform. Passing `number[]` is deprecated. |
85
-
|`decode`|`(tokens: number[] \| Int32Array, encoderOutput: Float32Array \| number[]) => Promise<Float32Array>`| Runs the decoder of the model. Passing `number[]` is deprecated. |
86
-
|`committedTranscription`|`string`| Contains the part of the transcription that is finalized and will not change. Useful for displaying stable results during streaming. |
87
-
|`nonCommittedTranscription`|`string`| Contains the part of the transcription that is still being processed and may change. Useful for displaying live, partial results during streaming. |
88
-
|`error`|`string \| null`| Contains the error message if the model failed to load. |
89
-
|`isGenerating`|`boolean`| Indicates whether the model is currently processing an inference. |
90
-
|`isReady`|`boolean`| Indicates whether the model has successfully loaded and is ready for inference. |
91
-
|`downloadProgress`|`number`| Tracks the progress of the model download process. |
|`transcribe`|`(waveform: Float32Array \| number[], options?: DecodingOptions \| undefined) => Promise<string>`| Starts a transcription process for a given input array, which should be a waveform at 16kHz. The second argument is an options object, e.g. `{ language: 'es' }` for multilingual models. Resolves a promise with the output transcription when the model is finished. Passing `number[]` is deprecated. |
81
+
|`stream`|`(options?: DecodingOptions \| undefined) => Promise<string>`| Starts a streaming transcription process. Use in combination with `streamInsert` to feed audio chunks and `streamStop` to end the stream. The argument is an options object, e.g. `{ language: 'es' }` for multilingual models. Updates `committedTranscription` and `nonCommittedTranscription` as transcription progresses. |
82
+
|`streamInsert`|`(waveform: Float32Array \| number[]) => void`| Inserts a chunk of audio data (sampled at 16kHz) into the ongoing streaming transcription. Call this repeatedly as new audio data becomes available. Passing `number[]` is deprecated. |
83
+
|`streamStop`|`() => void`| Stops the ongoing streaming transcription process. |
84
+
|`encode`|`(waveform: Float32Array \| number[]) => Promise<Float32Array>`| Runs the encoding part of the model on the provided waveform. Passing `number[]` is deprecated. |
85
+
|`decode`|`(tokens: number[] \| Int32Array, encoderOutput: Float32Array \| number[]) => Promise<Float32Array>`| Runs the decoder of the model. Passing `number[]` is deprecated. |
86
+
|`committedTranscription`|`string`| Contains the part of the transcription that is finalized and will not change. Useful for displaying stable results during streaming. |
87
+
|`nonCommittedTranscription`|`string`| Contains the part of the transcription that is still being processed and may change. Useful for displaying live, partial results during streaming. |
88
+
|`error`|`string \| null`| Contains the error message if the model failed to load. |
89
+
|`isGenerating`|`boolean`| Indicates whether the model is currently processing an inference. |
90
+
|`isReady`|`boolean`| Indicates whether the model has successfully loaded and is ready for inference. |
91
+
|`downloadProgress`|`number`| Tracks the progress of the model download process. |
92
92
93
93
<details>
94
94
<summary>Type definitions</summary>
@@ -340,4 +340,4 @@ function App() {
340
340
341
341
| Model | Android (XNNPACK) [MB]| iOS (XNNPACK) [MB]|
Times presented in the tables are measured as consecutive runs of the model. Initial run times may be up to 2x longer due to model loading and initialization.
146
146
:::
147
147
148
-
| Model | iPhone 16 Pro (XNNPACK) [ms]| iPhone 14 Pro Max (XNNPACK) [ms]| iPhone SE 3 (XNNPACK) [ms]| Samsung Galaxy S24 (XNNPACK) | OnePlus 12 (XNNPACK) [ms]|
Benchmark times for text embeddings are highly dependent on the sentence length. The numbers above are based on a sentence of around 80 tokens. For shorter or longer sentences, inference time may vary accordingly.
Times presented in the tables are measured as consecutive runs of the model. Initial run times may be up to 2x longer due to model loading and initialization.
109
109
:::
110
110
111
-
| Model | iPhone 16 Pro (Core ML) [ms]| iPhone 13 Pro (Core ML) [ms]| iPhone SE 3 (Core ML) [ms]| Samsung Galaxy S24 (XNNPACK) [ms]| OnePlus 12 (XNNPACK) [ms]|
111
+
| Model | iPhone 17 Pro (Core ML) [ms]| iPhone 16 Pro (Core ML) [ms]| iPhone SE 3 (Core ML) [ms]| Samsung Galaxy S24 (XNNPACK) [ms]| OnePlus 12 (XNNPACK) [ms]|
Copy file name to clipboardExpand all lines: docs/docs/02-hooks/02-computer-vision/useImageEmbeddings.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,9 +123,9 @@ For the supported models, the returned embedding vector is normalized, meaning t
123
123
Times presented in the tables are measured as consecutive runs of the model. Initial run times may be up to 2x longer due to model loading and initialization. Performance also heavily depends on image size, because resize is expansive operation, especially on low-end devices.
124
124
:::
125
125
126
-
| Model | iPhone 16 Pro (XNNPACK) [ms]| iPhone 14 Pro Max (XNNPACK) [ms]| iPhone SE 3 (XNNPACK) [ms]| Samsung Galaxy S24 (XNNPACK) [ms]| OnePlus 12 (XNNPACK) [ms]|
Image embedding benchmark times are measured using 224×224 pixel images, as required by the model. All input images, whether larger or smaller, are resized to 224×224 before processing. Resizing is typically fast for small images but may be noticeably slower for very large images, which can increase total inference time.
0 commit comments