Transforms#
aitlas.transforms.big_earth_net module#
Contains classes for image transformations specific for Big Earth Net dataset.
- class ResizeToTensorNormalizeRGB(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing, tensor conversion, and normalization to RGB images.
Initialize the class with the given mean and standard deviation for normalization.
- Parameters:
- configurables = ['bands10_mean', 'bands10_std']#
- class ToTensorResizeRandomCropFlipHV(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing, tensor conversion, random cropping, and random flipping to images.
- class ToTensorResizeCenterCrop(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing, tensor conversion, and center cropping to images.
- class ToTensorResize(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing and tensor conversion to images.
- class NormalizeAllBands(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies normalization to all bands of the input.
Initialize the class with the given mean and standard deviation for normalization.
- Parameters:
- configurables = ['bands10_mean', 'bands10_std', 'bands20_mean', 'bands20_std']#
- class ToTensorAllBands(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class for converting all bands (list) to tensors.
aitlas.transforms.breizhcrops module#
Contains classes for image transformations specific for BreizhCrops dataset.
- class SelectBands(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class used to select and process spectral bands from satellite data.
- Parameters:
level (str) – satellite data level to be processed (“L1C” or “L2A”)
Note
This class requires a level argument at initialization. This should be one of the predefined satellite data levels (“L1C” or “L2A”).
Initialize the SelectBands class by setting the satellite data level.
- configurables = ['level']#
aitlas.transforms.classification module#
Contains classes for image transformations for classification datasets.
- class ResizeRandomCropFlipHVToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing to (256,256), random cropping to size (224,224), random flipping, and tensor conversion to images.
- class ResizeCenterCropFlipHVToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing to (256,256), center cropping to size (224,224), random HV flipping, and tensor conversion to images.
- class ResizeCenterCropToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing to (256,256), center cropping to size (224,224), and tensor conversion to images.
- class Resize1ToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies fixed resizing to (224,224) and tensor conversion to images.
- class GrayToRGB(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that converts grayscale images to RGB format [height, width, channels].
- class ConvertToRGBResizeCenterCropToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that converts an image to RGB format, applies resizing to size (256,256), center cropping to size (224,224), and tensor conversion.
- class RandomFlipHVToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies random flipping and tensor conversion to images.
- class ComplexTransform(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies complex transformations to images and tensor conversion.
The transformations include:
resizing to (256,256), random cropping to size (224,224),
random flipping (H and V) with probability 50%,
random brightness and constrast with probability 75%,
random blur (motion, median, gaussian, and noise) with probability 70%,
random distortion (optical, grid, elastic) with probability 70%,,
random CLAHE with probability 70%,
random HSV shift with probability 50%,
aitlas.transforms.joint_transforms module#
Contains joint transforms for images and label masks.
- class FlipHVRandomRotate(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies flipping, random rotation, and shift-scale-rotation transformations to image and mask pairs.
- class FlipHVToTensorV2(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing, flipping, and tensor conversion to images with bounding boxes and labels.
- class ResizeToTensorV2(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing and tensor conversion to images with bounding boxes and labels.
- class Resize(*args, **kwargs)[source]#
Bases:
BaseTransforms
A class that applies resizing to images.
aitlas.transforms.object_detection module#
aitlas.transforms.segmentation module#
Classes and methods for image transformations for segmentation tasks. For semantic segmentation tasks the shape of the input is (N, 3, H, W); The shape of the output/mask is (N, num_classes, H, W), where N is the number of images
- class MinMaxNormTranspose(*args, **kwargs)[source]#
Bases:
BaseTransforms
MinMax Normalization and transposing a given sample.
- class Transpose(*args, **kwargs)[source]#
Bases:
BaseTransforms
Transposes a given sample.
- class MinMaxNorm(*args, **kwargs)[source]#
Bases:
BaseTransforms
MinMax-Normalization of a given sample.
- class Pad(*args, **kwargs)[source]#
Bases:
BaseTransforms
Applies padding to a given sample.
- class ColorTransformations(*args, **kwargs)[source]#
Bases:
BaseTransforms
Applies a set of color transformations to a given sample.
- class ResizeToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
Resizes and converts a given sample to a tensor.
- class ResizePerChannelToTensor(*args, **kwargs)[source]#
Bases:
BaseTransforms
aitlas.transforms.spacenet6 module#
Classes and methods for image transformations specific for the Spacenet6 dataset.
- saturation(img, alpha)[source]#
Adjust the saturation of an image.
- Parameters:
img (numpy.ndarray) – input image
alpha (float) – saturation factor
- Returns:
image with adjusted saturation
- Return type:
- brightness(img, alpha)[source]#
Adjust the brightness of an image.
- Parameters:
img (numpy.ndarray) – input image
alpha (float) – brightness factor
- Returns:
image with adjusted brightness
- Return type:
- contrast(img, alpha)[source]#
Adjust the contrast of an image.
- Parameters:
img (numpy.ndarray) – input image
alpha (float) – contrast factor
- Returns:
image with adjusted contrast
- Return type:
- class SpaceNet6Transforms(*args, **kwargs)[source]#
Bases:
BaseTransforms
SpaceNet6 specific image transformations.