pub struct OcrRunner { /* private fields */ }Expand description
OCR session wrapping a fully loaded OcrEngine.
Implementations§
Source§impl OcrRunner
impl OcrRunner
pub fn builder() -> OcrRunnerBuilder
pub fn engine(&self) -> &OcrEngine
pub fn device(&self) -> Device
pub fn config(&self) -> OcrConfig
Sourcepub fn predict_path(&self, path: &Path) -> Result<OcrOutput>
pub fn predict_path(&self, path: &Path) -> Result<OcrOutput>
Run OCR on an image file (JPEG/PNG via image crate).
Sourcepub fn predict_rgb(
&self,
rgb: &[u8],
width: u32,
height: u32,
) -> Result<OcrOutput>
pub fn predict_rgb( &self, rgb: &[u8], width: u32, height: u32, ) -> Result<OcrOutput>
Run OCR on RGB8 bytes.
Sourcepub fn predict_text(&self, path: &Path) -> Result<String>
pub fn predict_text(&self, path: &Path) -> Result<String>
Convenience: text only.
Auto Trait Implementations§
impl !Freeze for OcrRunner
impl RefUnwindSafe for OcrRunner
impl Send for OcrRunner
impl Sync for OcrRunner
impl Unpin for OcrRunner
impl UnsafeUnpin for OcrRunner
impl UnwindSafe for OcrRunner
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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 more