Geometric Transformations
Resize
- class augmax.Resize(width: int, height: int | None = None)[source]
Augmentation Examples for Resize(100, 100)
Crop
- class augmax.Crop(x0, y0, w, h)[source]
Crop the image at the specified x0 and y0 with given width and height
- Parameters:
x0 (float) – x-coordinate of the crop’s top-left corner
y0 (float) – y-coordinate of the crop’s top-left corner
w (float) – width of the crop
h (float) – height of the crop
Augmentation Examples for Crop(0, 0, 100, 100)
CenterCrop
- class augmax.CenterCrop(width: int, height: int | None = None)[source]
Extracts a central crop from the image with given width and height.
- Parameters:
w (float) – width of the crop
h (float) – height of the crop
Augmentation Examples for CenterCrop(100, 100)
RandomCrop
- class augmax.RandomCrop(width: int, height: int | None = None)[source]
Extracts a random crop from the image with given width and height.
- Parameters:
w (float) – width of the crop
h (float) – height of the crop
Augmentation Examples for RandomCrop(100, 100)
RandomSizedCrop
- class augmax.RandomSizedCrop(width: int, height: int | None = None, zoom_range: Tuple[float, float] = (0.5, 2.0), prevent_underzoom: bool = True)[source]
Extracts a randomly sized crop from the image and rescales it to the given width and height.
- Parameters:
w (float) – width of the crop
h (float) – height of the crop
zoom_range (float, float) – minimum and maximum zoom level for the transformation
prevent_underzoom (bool) – whether to prevent zooming beyond the image size
Augmentation Examples for RandomSizedCrop(100, 100)
HorizontalFlip
- class augmax.HorizontalFlip(p: float = 0.5)[source]
Randomly flips an image horizontally.
- Parameters:
p (float) – Probability of applying the transformation
Augmentation Examples for HorizontalFlip(p=1.0)
VerticalFlip
- class augmax.VerticalFlip(p: float = 0.5)[source]
Randomly flips an image vertically.
- Parameters:
p (float) – Probability of applying the transformation
Augmentation Examples for VerticalFlip(p=1.0)
Rotate90
- class augmax.Rotate90[source]
Randomly rotates the image by a multiple of 90 degrees.
Augmentation Examples for Rotate90()
Rotate
- class augmax.Rotate(angle_range: Tuple[float, float] | float = (-30, 30), p: float = 1.0)[source]
Rotates the image by a random arbitrary angle.
- Parameters:
angle_range (float, float) – Tuple of (min_angle, max_angle) to sample from. If only a single number is given, angles will be sampled from (-angle_range, angle_range).
p (float) – Probability of applying the transformation
Augmentation Examples for Rotate(p=1.0)
Warp
- class augmax.Warp(strength: int = 5, coarseness: int = 32)[source]
Warp an image (similar to ElasticTransform).
- Parameters:
strength (float) – How strong the transformation is, corresponds to the standard deviation of deformation values.
coarseness (float) – Size of the initial deformation grid cells. Lower values lead to a more noisy deformation.
Augmentation Examples for Warp()