oar-ocr-core 0.6.3

Core types and predictors for oar-ocr
Documentation
//! The core module of the OCR pipeline.
//!
//! This module contains the fundamental components of the OCR pipeline, including:
//! - Batch processing utilities
//! - Configuration management
//! - Constants used throughout the pipeline
//! - Error handling
//! - Inference engine integration
//! - Prediction result types
//! - Traits defining interfaces for various components
//!
//! It also provides re-exports of commonly used types and functions for convenience.

pub mod batch;
pub mod config;
pub mod constants;
pub mod errors;
pub mod image_reader;
pub mod inference;
#[macro_use]
pub mod macros;
pub mod traits;
pub mod validation;

// Image utilities are now available directly from oar_ocr::utils
// pub use crate::utils::{
//     create_rgb_image, dynamic_to_gray, dynamic_to_rgb, load_image, load_images,
// };
pub use crate::domain::{
    IntoOwnedPrediction, IntoPrediction, OrientationResult, OwnedPredictionResult,
    PredictionResult, apply_document_orientation, apply_text_line_orientation,
    format_orientation_label, get_document_orientation_labels, get_text_line_orientation_labels,
    parse_document_orientation, parse_orientation_angle, parse_text_line_orientation,
};
pub use batch::dynamic::{
    BatchPerformanceMetrics, CompatibleBatch, CrossImageBatch, CrossImageItem,
    DefaultDynamicBatcher, DynamicBatchConfig, DynamicBatchResult, DynamicBatcher, PaddingStrategy,
    ShapeCompatibilityStrategy,
};
pub use batch::{BatchData, BatchSampler, ToBatch};
pub use config::{
    ConfigError, ConfigValidator, ConfigValidatorExt, ModelInferenceConfig, TransformConfig,
    TransformRegistry, TransformType,
};
pub use constants::*;
pub use errors::{OCRError, OcrResult, OpaqueError, ProcessingStage};
pub use image_reader::DefaultImageReader;
pub use inference::{OrtInfer, TensorInput, TensorOutput, load_session};
pub use traits::{
    AdapterBuilder, AdapterInfo, AdapterTask, GranularImageReader, ImageReader, ImageTaskInput,
    ModelAdapter, Postprocessor, Preprocessor, Sampler, Task, TaskRunner, TaskSchema, TaskType,
};

pub use validation::{
    validate_batch_size, validate_division, validate_finite, validate_image_dimensions,
    validate_index_bounds, validate_non_empty, validate_non_negative,
    validate_normalization_params, validate_positive, validate_range, validate_same_length,
    validate_tensor_shape,
};

// init_tracing function has been moved to oar_ocr::utils::init_tracing