pub struct OAROCR { /* private fields */ }Expand description
The main OCR pipeline that combines multiple components to perform document processing and text recognition.
This struct manages the complete OCR pipeline, including document orientation classification, text detection, text recognition, and text line classification. It initializes and coordinates all the required components based on the provided configuration.
Implementations§
Source§impl OAROCR
impl OAROCR
Sourcepub fn new(config: OAROCRConfig) -> OcrResult<Self>
pub fn new(config: OAROCRConfig) -> OcrResult<Self>
Creates a new OAROCR instance with the provided configuration.
This method initializes all the required components based on the configuration and builds the complete OCR pipeline.
§Arguments
config- The configuration for the OCR pipeline
§Returns
A Result containing the OAROCR instance or an OCRError
Sourcepub fn predict(&self, images: &[RgbImage]) -> OcrResult<Vec<OAROCRResult>>
pub fn predict(&self, images: &[RgbImage]) -> OcrResult<Vec<OAROCRResult>>
Processes one or more images through the OCR pipeline.
This method runs the complete OCR pipeline on either a single image or a batch of images, including document orientation classification, text detection, text recognition, and text line classification (if enabled).
Multiple images are processed in parallel using rayon for optimal performance.
§Arguments
image_paths- A slice of paths to the image files
§Returns
A Result containing a vector of OAROCRResult or an OCRError Processes one or more images already loaded in memory.
Prefer this API when you have RgbImage instances to avoid file I/O.
Sourcepub fn get_stats(&self) -> PipelineStats
pub fn get_stats(&self) -> PipelineStats
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Resets the pipeline statistics.
Sourcepub fn get_config(&self) -> &OAROCRConfig
pub fn get_config(&self) -> &OAROCRConfig
Auto Trait Implementations§
impl !Freeze for OAROCR
impl RefUnwindSafe for OAROCR
impl Send for OAROCR
impl Sync for OAROCR
impl Unpin for OAROCR
impl UnwindSafe for OAROCR
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> 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<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.