pub struct DetOptions {Show 13 fields
pub max_side_len: u32,
pub box_threshold: f32,
pub unclip_ratio: f32,
pub score_threshold: f32,
pub min_area: u32,
pub box_border: u32,
pub merge_boxes: bool,
pub merge_threshold: i32,
pub precision_mode: DetPrecisionMode,
pub multi_scales: Vec<f32>,
pub block_size: u32,
pub block_overlap: u32,
pub nms_threshold: f32,
}Expand description
Detection options
Fields§
§max_side_len: u32Maximum image side length limit (will be scaled if exceeded)
box_threshold: f32Bounding box binarization threshold (0.0 - 1.0)
unclip_ratio: f32Text box expansion ratio
score_threshold: f32Pixel-level segmentation threshold
min_area: u32Minimum bounding box area
box_border: u32Bounding box border expansion
merge_boxes: boolWhether to merge adjacent text boxes
merge_threshold: i32Merge distance threshold
precision_mode: DetPrecisionModePrecision mode
multi_scales: Vec<f32>Scale ratios for multi-scale detection (high precision mode only)
block_size: u32Block size for block detection (high precision mode only)
block_overlap: u32Overlap area for block detection
nms_threshold: f32NMS IoU threshold
Implementations§
Source§impl DetOptions
impl DetOptions
Sourcepub fn with_max_side_len(self, len: u32) -> Self
pub fn with_max_side_len(self, len: u32) -> Self
Set maximum side length
Sourcepub fn with_box_threshold(self, threshold: f32) -> Self
pub fn with_box_threshold(self, threshold: f32) -> Self
Set bounding box threshold
Sourcepub fn with_score_threshold(self, threshold: f32) -> Self
pub fn with_score_threshold(self, threshold: f32) -> Self
Set segmentation threshold
Sourcepub fn with_min_area(self, area: u32) -> Self
pub fn with_min_area(self, area: u32) -> Self
Set minimum area
Sourcepub fn with_box_border(self, border: u32) -> Self
pub fn with_box_border(self, border: u32) -> Self
Set box border expansion
Sourcepub fn with_merge_boxes(self, merge: bool) -> Self
pub fn with_merge_boxes(self, merge: bool) -> Self
Enable box merging
Sourcepub fn with_merge_threshold(self, threshold: i32) -> Self
pub fn with_merge_threshold(self, threshold: i32) -> Self
Set merge threshold
Sourcepub fn with_precision_mode(self, mode: DetPrecisionMode) -> Self
pub fn with_precision_mode(self, mode: DetPrecisionMode) -> Self
Set precision mode
Sourcepub fn with_multi_scales(self, scales: Vec<f32>) -> Self
pub fn with_multi_scales(self, scales: Vec<f32>) -> Self
Set multi-scale ratios
Sourcepub fn with_block_size(self, size: u32) -> Self
pub fn with_block_size(self, size: u32) -> Self
Set block size
Trait Implementations§
Source§impl Clone for DetOptions
impl Clone for DetOptions
Source§fn clone(&self) -> DetOptions
fn clone(&self) -> DetOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DetOptions
impl Debug for DetOptions
Auto Trait Implementations§
impl Freeze for DetOptions
impl RefUnwindSafe for DetOptions
impl Send for DetOptions
impl Sync for DetOptions
impl Unpin for DetOptions
impl UnsafeUnpin for DetOptions
impl UnwindSafe for DetOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().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.