pub struct ImageNormalize {
pub mean: [f32; 3],
pub std: [f32; 3],
}Expand description
Per-channel normalization applied to image pixels before they
enter the projector. The default ([0,1] range with no mean/std
shift) is what a naive u8 / 255 does; Self::imagenet gives
the (mean, std) commonly used by HF vision processors including
the Gemma 4 unified reference.
Fields§
§mean: [f32; 3]§std: [f32; 3]Implementations§
Source§impl ImageNormalize
impl ImageNormalize
Sourcepub const fn unit() -> ImageNormalize
pub const fn unit() -> ImageNormalize
Plain u8 / 255 — output in [0, 1].
Sourcepub const fn imagenet() -> ImageNormalize
pub const fn imagenet() -> ImageNormalize
Standard ImageNet mean/std (RGB). The Gemma 4 unified vision tower expects this shift; CLIP/SigLIP family uses [0.5; 3].
Sourcepub const fn clip() -> ImageNormalize
pub const fn clip() -> ImageNormalize
CLIP / OpenAI vision encoders.
Trait Implementations§
Source§impl Clone for ImageNormalize
impl Clone for ImageNormalize
Source§fn clone(&self) -> ImageNormalize
fn clone(&self) -> ImageNormalize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImageNormalize
Source§impl Debug for ImageNormalize
impl Debug for ImageNormalize
Source§impl Default for ImageNormalize
impl Default for ImageNormalize
Source§fn default() -> ImageNormalize
fn default() -> ImageNormalize
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ImageNormalize
impl RefUnwindSafe for ImageNormalize
impl Send for ImageNormalize
impl Sync for ImageNormalize
impl Unpin for ImageNormalize
impl UnsafeUnpin for ImageNormalize
impl UnwindSafe for ImageNormalize
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more