pub struct ImageEmbedding { /* private fields */ }Expand description
Rust representation of the ImageEmbedding model
Implementations§
Source§impl ImageEmbedding
impl ImageEmbedding
Sourcepub fn try_new(options: ImageInitOptions) -> Result<Self>
pub fn try_new(options: ImageInitOptions) -> Result<Self>
Try to generate a new ImageEmbedding Instance
Uses the highest level of Graph optimization
Uses the total number of CPUs available as the number of intra-threads
Sourcepub fn try_new_from_user_defined(
model: UserDefinedImageEmbeddingModel,
options: ImageInitOptionsUserDefined,
) -> Result<Self>
pub fn try_new_from_user_defined( model: UserDefinedImageEmbeddingModel, options: ImageInitOptionsUserDefined, ) -> Result<Self>
Create a ImageEmbedding instance from model files provided by the user.
This can be used for ‘bring your own’ embedding models
Sourcepub fn list_supported_models() -> Vec<ModelInfo<ImageEmbeddingModel>>
pub fn list_supported_models() -> Vec<ModelInfo<ImageEmbeddingModel>>
Retrieve a list of supported models
Sourcepub fn get_model_info(
model: &ImageEmbeddingModel,
) -> ModelInfo<ImageEmbeddingModel>
pub fn get_model_info( model: &ImageEmbeddingModel, ) -> ModelInfo<ImageEmbeddingModel>
Get ModelInfo from ImageEmbeddingModel
Sourcepub fn embed_bytes(
&mut self,
images: &[&[u8]],
batch_size: Option<usize>,
) -> Result<Vec<Embedding>>
pub fn embed_bytes( &mut self, images: &[&[u8]], batch_size: Option<usize>, ) -> Result<Vec<Embedding>>
Method to generate image embeddings for a Vec of image bytes
Sourcepub fn embed<S: AsRef<Path> + Send + Sync>(
&mut self,
images: impl AsRef<[S]>,
batch_size: Option<usize>,
) -> Result<Vec<Embedding>>
pub fn embed<S: AsRef<Path> + Send + Sync>( &mut self, images: impl AsRef<[S]>, batch_size: Option<usize>, ) -> Result<Vec<Embedding>>
Method to generate image embeddings for a collection of image paths.
Accepts anything that can be referenced as a slice of elements implementing
AsRef<Path>, such as Vec<String>, Vec<PathBuf>, &[&str], or &[&Path].
Sourcepub fn embed_images(
&mut self,
imgs: Vec<DynamicImage>,
) -> Result<Vec<Embedding>>
pub fn embed_images( &mut self, imgs: Vec<DynamicImage>, ) -> Result<Vec<Embedding>>
Embed DynamicImages
Auto Trait Implementations§
impl Freeze for ImageEmbedding
impl !RefUnwindSafe for ImageEmbedding
impl Send for ImageEmbedding
impl Sync for ImageEmbedding
impl Unpin for ImageEmbedding
impl !UnwindSafe for ImageEmbedding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more