pub struct RlxTextRecognizer { /* private fields */ }Expand description
Recognition backend using compiled native RLX CRNN + GRU graphs (per padded width).
Implementations§
Source§impl RlxTextRecognizer
impl RlxTextRecognizer
pub fn from_path( path: impl AsRef<Path>, device: Device, ) -> Result<RlxTextRecognizer, Error>
pub fn from_safetensors( path: &Path, device: Device, ) -> Result<RlxTextRecognizer, Error>
pub fn from_model_dir( dir: &Path, device: Device, ) -> Result<RlxTextRecognizer, Error>
Sourcepub fn run_batch_logits(
&self,
input: TensorBase<Vec<f32>, NdLayout<4>>,
) -> Result<TensorBase<Vec<f32>, NdLayout<3>>, Error>
pub fn run_batch_logits( &self, input: TensorBase<Vec<f32>, NdLayout<4>>, ) -> Result<TensorBase<Vec<f32>, NdLayout<3>>, Error>
Run recognition on an NCHW batch; returns [batch, seq, classes] log-probs.
pub fn prepare_input( &self, image: TensorBase<ViewData<'_, f32>, NdLayout<3>>, line: &[RotatedRect], ) -> TensorBase<Vec<f32>, NdLayout<2>>
pub fn recognize_text_lines( &self, image: TensorBase<ViewData<'_, f32>, NdLayout<3>>, lines: &[Vec<RotatedRect>], decode_method: DecodeMethod, alphabet: &str, excluded_char_labels: Option<&[usize]>, ) -> Result<Vec<Option<TextLine>>, Error>
Auto Trait Implementations§
impl !Freeze for RlxTextRecognizer
impl RefUnwindSafe for RlxTextRecognizer
impl Send for RlxTextRecognizer
impl Sync for RlxTextRecognizer
impl Unpin for RlxTextRecognizer
impl UnsafeUnpin for RlxTextRecognizer
impl UnwindSafe for RlxTextRecognizer
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