pub trait DynamicBatcher {
// Required methods
fn group_images_by_compatibility(
&self,
images: Vec<(usize, RgbImage)>,
config: &DynamicBatchConfig,
) -> Result<Vec<CompatibleBatch>, OCRError>;
fn group_cross_image_items(
&self,
items: Vec<(usize, usize, RgbImage)>,
config: &DynamicBatchConfig,
) -> Result<Vec<CrossImageBatch>, OCRError>;
fn batch_predict<P>(
&self,
predictor: &P,
images: Vec<RgbImage>,
config: Option<P::Config>,
) -> Result<Vec<P::Result>, OCRError>
where P: StandardPredictor;
}Expand description
Enhanced trait for dynamic batching functionality
Required Methods§
Sourcefn group_images_by_compatibility(
&self,
images: Vec<(usize, RgbImage)>,
config: &DynamicBatchConfig,
) -> Result<Vec<CompatibleBatch>, OCRError>
fn group_images_by_compatibility( &self, images: Vec<(usize, RgbImage)>, config: &DynamicBatchConfig, ) -> Result<Vec<CompatibleBatch>, OCRError>
Group images by compatible shapes for batching
Sourcefn group_cross_image_items(
&self,
items: Vec<(usize, usize, RgbImage)>,
config: &DynamicBatchConfig,
) -> Result<Vec<CrossImageBatch>, OCRError>
fn group_cross_image_items( &self, items: Vec<(usize, usize, RgbImage)>, config: &DynamicBatchConfig, ) -> Result<Vec<CrossImageBatch>, OCRError>
Group cross-image items (e.g., text regions from multiple images)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.