pub enum PredictionResult<'a, I = Arc<ImageBuffer<Rgb<u8>, Vec<u8>>>> {
Detection {
input_path: Vec<Cow<'a, str>>,
index: Vec<usize>,
input_img: Vec<I>,
dt_polys: Vec<Vec<BoundingBox>>,
dt_scores: Vec<Vec<f32>>,
},
Recognition {
input_path: Vec<Cow<'a, str>>,
index: Vec<usize>,
input_img: Vec<I>,
rec_text: Vec<Cow<'a, str>>,
rec_score: Vec<f32>,
},
Classification {
input_path: Vec<Cow<'a, str>>,
index: Vec<usize>,
input_img: Vec<I>,
class_ids: Vec<Vec<usize>>,
scores: Vec<Vec<f32>>,
label_names: Vec<Vec<Cow<'a, str>>>,
},
Rectification {
input_path: Vec<Cow<'a, str>>,
index: Vec<usize>,
input_img: Vec<I>,
rectified_img: Vec<I>,
},
}Expand description
Enum representing different types of prediction results.
This enum is used to represent the results of different types of predictions in the OCR pipeline, such as text detection, text recognition, image classification, and image rectification.
§Type Parameters
'a- The lifetime of the borrowed data.I- The type of the input images.
Variants§
Detection
Results from text detection.
Fields
dt_polys: Vec<Vec<BoundingBox>>The detected polygons.
Recognition
Results from text recognition.
Fields
Classification
Results from image classification.
Fields
Rectification
Results from image rectification.
Implementations§
Source§impl<'a, I> PredictionResult<'a, I>
Implementation of methods for PredictionResult.
impl<'a, I> PredictionResult<'a, I>
Implementation of methods for PredictionResult.
Sourcepub fn input_paths(&self) -> &[Cow<'a, str>]
pub fn input_paths(&self) -> &[Cow<'a, str>]
Sourcepub fn input_images(&self) -> &[I]
pub fn input_images(&self) -> &[I]
Sourcepub fn is_detection(&self) -> bool
pub fn is_detection(&self) -> bool
Checks if the prediction result is a detection result.
§Returns
True if the prediction result is a detection result, false otherwise.
Sourcepub fn is_recognition(&self) -> bool
pub fn is_recognition(&self) -> bool
Checks if the prediction result is a recognition result.
§Returns
True if the prediction result is a recognition result, false otherwise.
Sourcepub fn is_classification(&self) -> bool
pub fn is_classification(&self) -> bool
Checks if the prediction result is a classification result.
§Returns
True if the prediction result is a classification result, false otherwise.
Sourcepub fn is_rectification(&self) -> bool
pub fn is_rectification(&self) -> bool
Checks if the prediction result is a rectification result.
§Returns
True if the prediction result is a rectification result, false otherwise.
Sourcepub fn into_owned(self) -> OwnedPredictionResult<I>
pub fn into_owned(self) -> OwnedPredictionResult<I>
Converts the prediction result to an owned prediction result.
§Returns
An OwnedPredictionResult with the same data.
Trait Implementations§
Source§impl<'a, I> Clone for PredictionResult<'a, I>where
I: Clone,
impl<'a, I> Clone for PredictionResult<'a, I>where
I: Clone,
Source§fn clone(&self) -> PredictionResult<'a, I>
fn clone(&self) -> PredictionResult<'a, I>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a, I> Debug for PredictionResult<'a, I>where
I: Debug,
impl<'a, I> Debug for PredictionResult<'a, I>where
I: Debug,
Source§impl<I> From<PredictionResult<'_, I>> for OwnedPredictionResult<I>
Implementation of From for converting PredictionResult to OwnedPredictionResult.
impl<I> From<PredictionResult<'_, I>> for OwnedPredictionResult<I>
Implementation of From for converting PredictionResult to OwnedPredictionResult.
This implementation allows PredictionResult to be converted to OwnedPredictionResult.
Source§fn from(result: PredictionResult<'_, I>) -> OwnedPredictionResult<I>
fn from(result: PredictionResult<'_, I>) -> OwnedPredictionResult<I>
Auto Trait Implementations§
impl<'a, I> Freeze for PredictionResult<'a, I>
impl<'a, I> RefUnwindSafe for PredictionResult<'a, I>where
I: RefUnwindSafe,
impl<'a, I> Send for PredictionResult<'a, I>where
I: Send,
impl<'a, I> Sync for PredictionResult<'a, I>where
I: Sync,
impl<'a, I> Unpin for PredictionResult<'a, I>where
I: Unpin,
impl<'a, I> UnwindSafe for PredictionResult<'a, I>where
I: UnwindSafe,
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<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.