pub trait Preprocessor:
Send
+ Sync
+ Debug {
type Config: Send + Sync + Debug;
type Output: Send + Sync + Debug;
// Required method
fn preprocess(
&self,
images: Vec<RgbImage>,
config: Option<&Self::Config>,
) -> Result<Self::Output, OCRError>;
// Provided methods
fn preprocessing_info(&self) -> String { ... }
fn validate_input(&self, images: &[RgbImage]) -> Result<(), OCRError> { ... }
}Expand description
Trait for image preprocessing operations.
This trait handles transforming raw images into the format required by the inference engine (resizing, normalization, tensor conversion, etc.).
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn preprocessing_info(&self) -> String
fn preprocessing_info(&self) -> String
Get information about the preprocessing requirements.
§Returns
String describing preprocessing requirements (input size, format, etc.)