Function: useImageEmbedder()
useImageEmbedder(
config,options?):object
Defined in: hooks/useImageEmbedder.ts:25
React hook to load and run an image embedding model.
This hook manages downloading (if remote URLs are provided) and loading the model assets, compiling them, tracking download progress and load errors, and releasing native memory when the component unmounts or the configuration changes.
For imperative usage, see createImageEmbedder.
Parameters
config
The image embedder model configuration. See ImageEmbedderModel.
options?
Load and caching options. See ResourceOptions.
Returns
object
The same object as ImageEmbedder (without dispose),
combined with loading state and download progress.
downloadProgress
downloadProgress:
any
embed
embed:
any=model.embed
embedWorklet
embedWorklet:
any=model.embedWorklet
error
error:
any
isReady
isReady:
boolean=!!model
resource
resource:
any