pub struct EmbeddingEngine { /* private fields */ }Expand description
Engine for generating CLIP image embeddings.
Implementations§
Source§impl EmbeddingEngine
impl EmbeddingEngine
Sourcepub fn new(model_path: Option<&str>) -> VisionResult<Self>
pub fn new(model_path: Option<&str>) -> VisionResult<Self>
Create a new embedding engine.
If model_path is provided, loads the model from that path.
Otherwise, looks in ~/.agentic-vision/models/.
If no model is found, the engine operates in fallback mode (zero vectors).
Sourcepub fn embed(&mut self, img: &DynamicImage) -> VisionResult<Vec<f32>>
pub fn embed(&mut self, img: &DynamicImage) -> VisionResult<Vec<f32>>
Generate an embedding for an image.
Returns a 512-dimensional vector. If no model is loaded, returns zeros.
Auto Trait Implementations§
impl Freeze for EmbeddingEngine
impl !RefUnwindSafe for EmbeddingEngine
impl Send for EmbeddingEngine
impl Sync for EmbeddingEngine
impl Unpin for EmbeddingEngine
impl UnsafeUnpin for EmbeddingEngine
impl !UnwindSafe for EmbeddingEngine
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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