pub struct ImageProcessorRegistry { /* private fields */ }Expand description
Registry of available image processors.
Implementations§
Source§impl ImageProcessorRegistry
impl ImageProcessorRegistry
Sourcepub fn register(
&mut self,
pattern: impl Into<String>,
processor: Box<dyn ImagePreProcessor>,
)
pub fn register( &mut self, pattern: impl Into<String>, processor: Box<dyn ImagePreProcessor>, )
Register a processor for a model pattern.
Sourcepub fn find(
&self,
model_id: &str,
model_type: Option<&str>,
) -> Option<&dyn ImagePreProcessor>
pub fn find( &self, model_id: &str, model_type: Option<&str>, ) -> Option<&dyn ImagePreProcessor>
Find a processor for the given model ID, falling back to model_type.
Matches by substring containment (case-insensitive).
Sourcepub fn supported_patterns(&self) -> Vec<&str>
pub fn supported_patterns(&self) -> Vec<&str>
Get list of supported model patterns.
Source§impl ImageProcessorRegistry
impl ImageProcessorRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a registry with all built-in processors registered.
Currently registers:
llava-next-> LlavaNextProcessorllava-1.5/llava-v1.5-> LlavaProcessorqwen2-vl-> Qwen2VLProcessorqwen2.5-vl-> Qwen2VLProcessor (same preprocessing as Qwen2-VL)qwen3-vl-> Qwen3VLProcessor (patch_size=16, [0.5,0.5,0.5] normalization)phi-3-vision-> Phi3VisionProcessor (HD transform with 336x336 tiles)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageProcessorRegistry
impl !RefUnwindSafe for ImageProcessorRegistry
impl Send for ImageProcessorRegistry
impl Sync for ImageProcessorRegistry
impl Unpin for ImageProcessorRegistry
impl UnsafeUnpin for ImageProcessorRegistry
impl !UnwindSafe for ImageProcessorRegistry
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