pub struct DBPostProcess {
pub thresh: f32,
pub box_thresh: f32,
pub max_candidates: usize,
pub unclip_ratio: f32,
pub min_size: f32,
pub score_mode: ScoreMode,
pub box_type: BoxType,
pub use_dilation: bool,
}Expand description
Post-processor for DB (Differentiable Binarization) text detection models.
Fields§
§thresh: f32Threshold for binarizing the prediction map (default: 0.3).
box_thresh: f32Threshold for filtering bounding boxes based on their score (default: 0.7).
max_candidates: usizeMaximum number of candidate bounding boxes to consider (default: 1000).
unclip_ratio: f32Ratio for unclipping (expanding) bounding boxes (default: 2.0).
min_size: f32Minimum side length for detected bounding boxes.
score_mode: ScoreModeMethod for calculating the score of a bounding box.
box_type: BoxTypeType of bounding box to generate (quadrilateral or polygon).
use_dilation: boolWhether to apply dilation to the segmentation mask before contour detection.
Implementations§
Source§impl DBPostProcess
impl DBPostProcess
Sourcepub fn box_score_fast(&self, pred: &Array2<f32>, bbox: &BoundingBox) -> f32
pub fn box_score_fast(&self, pred: &Array2<f32>, bbox: &BoundingBox) -> f32
Calculates the score of a bounding box using a fast approximation method.
Source§impl DBPostProcess
impl DBPostProcess
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DBPostProcess
impl RefUnwindSafe for DBPostProcess
impl Send for DBPostProcess
impl Sync for DBPostProcess
impl Unpin for DBPostProcess
impl UnwindSafe for DBPostProcess
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
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>
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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.