pub struct PreprocessConfig {
pub width: u32,
pub height: u32,
pub mean: [f32; 3],
pub std: [f32; 3],
pub scale_1_255: bool,
pub letterbox: bool,
pub letterbox_pad: u8,
}Expand description
ImageNet-style or custom normalize + resize plan.
Fields§
§width: u32Output width.
height: u32Output height.
mean: [f32; 3]Per-channel mean (RGB).
std: [f32; 3]Per-channel std (RGB).
scale_1_255: boolScale pixel values by 1/255 before mean/std.
letterbox: boolKeep aspect ratio and pad (YOLO letterbox) instead of stretching.
letterbox_pad: u8Letterbox pad value in 0..=255 (Ultralytics uses 114).
Implementations§
Source§impl PreprocessConfig
impl PreprocessConfig
Sourcepub fn imagenet_like(width: u32, height: u32) -> Self
pub fn imagenet_like(width: u32, height: u32) -> Self
Common re-id / classifier input size with ImageNet mean/std.
Stretches to width × height (no letterbox).
Sourcepub fn yolo_detect(width: u32, height: u32) -> Self
pub fn yolo_detect(width: u32, height: u32) -> Self
YOLO-style detector input: /255, zero mean, unit std, letterbox pad.
Trait Implementations§
Source§impl Clone for PreprocessConfig
impl Clone for PreprocessConfig
Source§impl Debug for PreprocessConfig
impl Debug for PreprocessConfig
Source§impl Default for PreprocessConfig
impl Default for PreprocessConfig
Source§impl<'de> Deserialize<'de> for PreprocessConfig
impl<'de> Deserialize<'de> for PreprocessConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PreprocessConfig
impl PartialEq for PreprocessConfig
Source§impl Serialize for PreprocessConfig
impl Serialize for PreprocessConfig
impl StructuralPartialEq for PreprocessConfig
Auto Trait Implementations§
impl Freeze for PreprocessConfig
impl RefUnwindSafe for PreprocessConfig
impl Send for PreprocessConfig
impl Sync for PreprocessConfig
impl Unpin for PreprocessConfig
impl UnsafeUnpin for PreprocessConfig
impl UnwindSafe for PreprocessConfig
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