pub enum OwnedPredictionResult<I = Arc<ImageBuffer<Rgb<u8>, Vec<u8>>>> {
Detection {
input_path: Vec<String>,
index: Vec<usize>,
input_img: Vec<I>,
dt_polys: Vec<Vec<BoundingBox>>,
dt_scores: Vec<Vec<f32>>,
},
Recognition {
input_path: Vec<String>,
index: Vec<usize>,
input_img: Vec<I>,
rec_text: Vec<String>,
rec_score: Vec<f32>,
},
Classification {
input_path: Vec<String>,
index: Vec<usize>,
input_img: Vec<I>,
class_ids: Vec<Vec<usize>>,
scores: Vec<Vec<f32>>,
label_names: Vec<Vec<String>>,
},
Rectification {
input_path: Vec<String>,
index: Vec<usize>,
input_img: Vec<I>,
rectified_img: Vec<I>,
},
}Expand description
Enum representing owned prediction results.
This enum is similar to PredictionResult, but uses owned String values instead of borrowed Cow values. It also implements Serialize and Deserialize traits for easy serialization and deserialization.
§Type Parameters
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<I> OwnedPredictionResult<I>
Implementation of methods for OwnedPredictionResult.
impl<I> OwnedPredictionResult<I>
Implementation of methods for OwnedPredictionResult.
Sourcepub fn input_paths(&self) -> &[String]
pub fn input_paths(&self) -> &[String]
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 as_prediction_result(&self) -> PredictionResult<'_, &I>
pub fn as_prediction_result(&self) -> PredictionResult<'_, &I>
Converts the owned prediction result to a borrowed prediction result.
§Returns
A PredictionResult with borrowed data.
Trait Implementations§
Source§impl<I> Clone for OwnedPredictionResult<I>where
I: Clone,
impl<I> Clone for OwnedPredictionResult<I>where
I: Clone,
Source§fn clone(&self) -> OwnedPredictionResult<I>
fn clone(&self) -> OwnedPredictionResult<I>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<I> Debug for OwnedPredictionResult<I>where
I: Debug,
impl<I> Debug for OwnedPredictionResult<I>where
I: Debug,
Source§impl<'de, I> Deserialize<'de> for OwnedPredictionResult<I>where
I: Default,
impl<'de, I> Deserialize<'de> for OwnedPredictionResult<I>where
I: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedPredictionResult<I>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OwnedPredictionResult<I>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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>
Source§impl<I> Serialize for OwnedPredictionResult<I>
impl<I> Serialize for OwnedPredictionResult<I>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl<I> Freeze for OwnedPredictionResult<I>
impl<I> RefUnwindSafe for OwnedPredictionResult<I>where
I: RefUnwindSafe,
impl<I> Send for OwnedPredictionResult<I>where
I: Send,
impl<I> Sync for OwnedPredictionResult<I>where
I: Sync,
impl<I> Unpin for OwnedPredictionResult<I>where
I: Unpin,
impl<I> UnwindSafe for OwnedPredictionResult<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.