Module oarocr

Module oarocr 

Source
Expand description

The main OCR pipeline implementation.

This module provides the complete OCR pipeline that combines multiple components to perform document orientation classification, text detection, text recognition, and text line classification.

§Orchestration Architecture

The pipeline has been refactored to use a unified orchestration system that eliminates code duplication and provides better maintainability. The key improvements include:

§Unified Processing Logic

Previously, methods like process_single_image, process_single_image_from_memory, process_images_individually, and process_images_from_memory contained duplicated orchestration logic for:

  • Parallel vs sequential processing decisions
  • Index management and result sorting
  • Pipeline stage execution patterns
  • Error handling and logging

Now, all these methods use the orchestration module’s abstractions:

§Benefits

  • Reduced Duplication: ~200 lines of duplicated code eliminated
  • Improved Maintainability: Changes to orchestration logic in one place
  • Better Testability: Each orchestration component can be tested independently
  • Type Safety: Compile-time prevention of invalid configurations
  • Consistent Behavior: All processing paths use the same underlying logic

§Backward Compatibility

The public API remains unchanged. All existing code using OAROCR::predict and related methods will continue to work without modification.

Re-exports§

pub use config::OnnxThreadingConfig;
pub use config::ParallelPolicy;

Structs§

ErrorMetrics
Error metrics for monitoring data quality and model performance issues.
ExtensibleOAROCR
Integration wrapper that bridges the extensible pipeline with OAROCR.
ExtensibleOAROCRBuilder
Builder for creating ExtensibleOAROCR instances.
ImageProcessingOrchestrator
Main orchestrator for image processing operations.
ImageProcessor
Image processing utilities for the OAROCR pipeline.
OAROCR
The main OCR pipeline that combines multiple components to perform document processing and text recognition.
OAROCRBuilder
Builder for creating OAROCR instances.
OAROCRConfig
OAROCRResult
Result of the OAROCR pipeline execution.
PipelineExecutor
Executor for OCR pipeline stages with configurable entry points.
PipelineStageConfig
Configuration for pipeline stage execution
SingleImageProcessingParams
TextRegion
A text region containing detection and recognition results.

Enums§

ImageInputSource
Represents different sources of image input for processing.
PipelineStage
Represents different stages in the OCR pipeline
ProcessingStrategy
Strategy for processing multiple images

Functions§

configure_thread_pool_once
Configures the global rayon thread pool if not already configured.