pub struct OAROCRConfig {Show 14 fields
pub detection: TextDetPredictorConfig,
pub recognition: TextRecPredictorConfig,
pub orientation: Option<DocOrientationClassifierConfig>,
pub rectification: Option<DoctrRectifierPredictorConfig>,
pub text_line_orientation: Option<TextLineClasPredictorConfig>,
pub orientation_stage: Option<OrientationConfig>,
pub text_line_orientation_stage: Option<TextLineOrientationConfig>,
pub character_dict_path: PathBuf,
pub use_doc_orientation_classify: bool,
pub use_doc_unwarping: bool,
pub use_textline_orientation: bool,
pub aspect_ratio_bucketing: Option<AspectRatioBucketingConfig>,
pub dynamic_batching: Option<DynamicBatchConfig>,
pub parallel_policy: ParallelPolicy,
}Fields§
§detection: TextDetPredictorConfigConfiguration for text detection.
recognition: TextRecPredictorConfigConfiguration for text recognition.
orientation: Option<DocOrientationClassifierConfig>Configuration for document orientation classification (optional).
rectification: Option<DoctrRectifierPredictorConfig>Configuration for document rectification/unwarping (optional).
text_line_orientation: Option<TextLineClasPredictorConfig>Configuration for text line orientation classification (optional).
orientation_stage: Option<OrientationConfig>Configuration for document orientation stage processing.
text_line_orientation_stage: Option<TextLineOrientationConfig>Configuration for text line orientation stage processing.
character_dict_path: PathBufPath to the character dictionary file for text recognition.
use_doc_orientation_classify: boolWhether to use document orientation classification.
use_doc_unwarping: boolWhether to use document unwarping.
use_textline_orientation: boolWhether to use text line orientation classification.
aspect_ratio_bucketing: Option<AspectRatioBucketingConfig>Configuration for aspect ratio bucketing in text recognition. If None, falls back to exact dimension grouping.
dynamic_batching: Option<DynamicBatchConfig>Configuration for dynamic batching across multiple images. If None, uses default dynamic batching configuration.
parallel_policy: ParallelPolicyCentralized parallel processing policy configuration
Implementations§
Source§impl OAROCRConfig
impl OAROCRConfig
Sourcepub fn new(
text_detection_model_path: impl Into<PathBuf>,
text_recognition_model_path: impl Into<PathBuf>,
character_dict_path: impl Into<PathBuf>,
) -> Self
pub fn new( text_detection_model_path: impl Into<PathBuf>, text_recognition_model_path: impl Into<PathBuf>, character_dict_path: impl Into<PathBuf>, ) -> Self
Creates a new OAROCRConfig with the required parameters.
This constructor initializes the configuration with default values for optional parameters while requiring the essential model paths.
§Arguments
text_detection_model_path- Path to the text detection model filetext_recognition_model_path- Path to the text recognition model filecharacter_dict_path- Path to the character dictionary file
§Returns
A new OAROCRConfig instance with default values
Sourcepub fn effective_parallel_policy(&self) -> ParallelPolicy
pub fn effective_parallel_policy(&self) -> ParallelPolicy
Get the effective parallel policy
Sourcepub fn max_threads(&self) -> Option<usize>
pub fn max_threads(&self) -> Option<usize>
Get the maximum number of threads for parallel processing
Sourcepub fn image_threshold(&self) -> usize
pub fn image_threshold(&self) -> usize
Get the image processing threshold
Sourcepub fn text_box_threshold(&self) -> usize
pub fn text_box_threshold(&self) -> usize
Get the text box processing threshold
Sourcepub fn batch_threshold(&self) -> usize
pub fn batch_threshold(&self) -> usize
Get the batch processing threshold
Sourcepub fn utility_threshold(&self) -> usize
pub fn utility_threshold(&self) -> usize
Get the utility operations threshold
Sourcepub fn postprocess_pixel_threshold(&self) -> usize
pub fn postprocess_pixel_threshold(&self) -> usize
Get the postprocessing pixel threshold
Sourcepub fn onnx_threading(&self) -> OnnxThreadingConfig
pub fn onnx_threading(&self) -> OnnxThreadingConfig
Get the ONNX threading configuration
Trait Implementations§
Source§impl Clone for OAROCRConfig
impl Clone for OAROCRConfig
Source§fn clone(&self) -> OAROCRConfig
fn clone(&self) -> OAROCRConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OAROCRConfig
impl Debug for OAROCRConfig
Source§impl Default for OAROCRConfig
Implementation of Default for OAROCRConfig.
impl Default for OAROCRConfig
Implementation of Default for OAROCRConfig.
This provides a default configuration that can be used for testing. Note: This default configuration will not work for actual OCR processing as it doesn’t specify valid model paths.
Source§impl<'de> Deserialize<'de> for OAROCRConfig
impl<'de> Deserialize<'de> for OAROCRConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for OAROCRConfig
impl RefUnwindSafe for OAROCRConfig
impl Send for OAROCRConfig
impl Sync for OAROCRConfig
impl Unpin for OAROCRConfig
impl UnwindSafe for OAROCRConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.