Expand description
Dynamic batching for OCR pipeline components.
This module provides functionality for dynamically batching images based on shape compatibility and performance requirements. It supports both same-image batching (multiple images) and cross-image batching (text regions from multiple images).
§Features
- Shape Compatibility: Group images by exact dimensions, aspect ratio, or custom strategies
- Flexible Batching: Support for detection and recognition batching
- Performance Metrics: Track batching performance and efficiency
- Cross-Image Batching: Batch text regions from multiple images together
§Example
use oar_ocr::core::{DynamicBatchConfig, DefaultDynamicBatcher, DynamicBatcher};
use image::RgbImage;
let config = DynamicBatchConfig::default();
let batcher = DefaultDynamicBatcher::new();
let images = vec![(0, RgbImage::new(100, 100)), (1, RgbImage::new(100, 100))];
let batches = batcher.group_images_by_compatibility(images, &config).unwrap();Structs§
- Batch
Performance Metrics - Performance metrics for batch operations
- Compatible
Batch - A batch of compatible images that can be processed together
- Cross
Image Batch - Batch of cross-image items
- Cross
Image Item - Cross-image item for batching (e.g., text regions from multiple images)
- Default
Dynamic Batcher - Default implementation of dynamic batcher
- Dynamic
Batch Config - Configuration for dynamic batching
- Dynamic
Batch Result - Result of dynamic batch processing
Enums§
- Padding
Strategy - Strategy for padding images to uniform size
- Shape
Compatibility Strategy - Strategy for determining shape compatibility
Traits§
- Dynamic
Batcher - Enhanced trait for dynamic batching functionality