Defined in: modules/computer_vision/ImageEmbeddingsModule.ts:13
Module for generating image embeddings from input images.
BaseModule
new ImageEmbeddingsModule():
ImageEmbeddingsModule
ImageEmbeddingsModule
BaseModule.constructor
nativeModule:
any=null
Defined in: modules/BaseModule.ts:8
Native module instance
BaseModule.nativeModule
delete():
void
Defined in: modules/BaseModule.ts:41
Unloads the model from memory.
void
BaseModule.delete
forward(
imageSource):Promise<Float32Array<ArrayBufferLike>>
Defined in: modules/computer_vision/ImageEmbeddingsModule.ts:50
Executes the model's forward pass. Returns an embedding array for a given sentence.
string
The image source (URI/URL) to image that will be embedded.
Promise<Float32Array<ArrayBufferLike>>
A Float32Array containing the image embeddings.
protectedforwardET(inputTensor):Promise<TensorPtr[]>
Defined in: modules/BaseModule.ts:23
Runs the model's forward method with the given input tensors. It returns the output tensors that mimic the structure of output from ExecuTorch.
Array of input tensors.
Promise<TensorPtr[]>
Array of output tensors.
BaseModule.forwardET
getInputShape(
methodName,index):Promise<number[]>
Defined in: modules/BaseModule.ts:34
Gets the input shape for a given method and index.
string
method name
number
index of the argument which shape is requested
Promise<number[]>
The input shape as an array of numbers.
BaseModule.getInputShape
load(
model,onDownloadProgressCallback):Promise<void>
Defined in: modules/computer_vision/ImageEmbeddingsModule.ts:20
Loads the model, where modelSource is a string that specifies the location of the model binary.
Object containing modelSource.
(progress) => void
Optional callback to monitor download progress.
Promise<void>
BaseModule.load