pub struct ImageAugmentation {
pub horizontal_flip: bool,
pub vertical_flip: bool,
pub rotation_range: f32,
pub width_shift_range: f32,
pub height_shift_range: f32,
pub zoom_range: (f32, f32),
pub brightness_range: (f32, f32),
pub random_seed: Option<u64>,
}Expand description
Image data augmentation
Fields§
§horizontal_flip: bool§vertical_flip: bool§rotation_range: f32§width_shift_range: f32§height_shift_range: f32§zoom_range: (f32, f32)§brightness_range: (f32, f32)§random_seed: Option<u64>Implementations§
Source§impl ImageAugmentation
impl ImageAugmentation
pub fn new() -> Self
pub fn horizontal_flip(self, flip: bool) -> Self
pub fn vertical_flip(self, flip: bool) -> Self
pub fn rotation_range(self, degrees: f32) -> Self
pub fn shift_range(self, width: f32, height: f32) -> Self
pub fn zoom_range(self, min: f32, max: f32) -> Self
pub fn brightness_range(self, min: f32, max: f32) -> Self
pub fn augment(&self, image: &Tensor) -> Tensor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageAugmentation
impl RefUnwindSafe for ImageAugmentation
impl Send for ImageAugmentation
impl Sync for ImageAugmentation
impl Unpin for ImageAugmentation
impl UnwindSafe for ImageAugmentation
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> 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