ParticleDetection.modelling.augmentations¶
Collection of custom image augmentations extending the Detectron2 augmentation pool. These augmentations are intended to be used during the training process of a neural network using the Detectron2 framework.
Author: Adrian Niemann (adrian.niemann@ovgu.de)
Date: 31.10.2022
- class GaussianBlur(*args: Any, **kwargs: Any)[source]¶
Bases:
TransformApplies a Gaussian blur using the imgaug library.
- Parameters
sigmas (Tuple[float, float]) –
Mean and variance of the constructed Gaussian kernel.
Default is
(0.0, 2.0).
- class GaussianBlurAugmentation(*args: Any, **kwargs: Any)[source]¶
Bases:
AugmentationDefines a strategy to blur images with a Gaussian blur operation.
- Parameters
sigmas (Tuple[float, float]) –
Mean and variance of the constructed Gaussian kernel.
Default is
(0.0, 2.0).
- class Multiply(*args: Any, **kwargs: Any)[source]¶
Bases:
TransformApplies a multipliction of each pixel with a certain value.
- Parameters
mul (Tuple[float, float]) – The value with which to multiply the pixel values in each image. A value from the interval will be sampled per image and used for all pixels. Default is
(0.8, 1.2)
- class MultiplyAugmentation(*args: Any, **kwargs: Any)[source]¶
Bases:
AugmentationDefines an augmentation strategy to multiply each pixel with a certain value.
- Parameters
mul (Tuple[float, float]) –
The value with which to multiply the pixel values in each image. A value from the interval will be sampled per image and used for all pixels.
Default is
(0.8, 1.2)
- class Sharpen(*args: Any, **kwargs: Any)[source]¶
Bases:
TransformApplies a sharpening transformation using the imgaug library.
- Parameters
alpha (Tuple[float, float]) –
Blending factor of the sharpened image. A random value will be sampled from the interval for every image.
Default is
(0.0, 0.2).lightness (Tuple[float, float]) –
Lightness/brightness of the sharped image. A random value will be sampled from the interval per image.
Default is
(0.8, 1.2).
- class SharpenAugmentation(*args: Any, **kwargs: Any)[source]¶
Bases:
AugmentationDefines an augmentation strategy to sharpen images.
- Parameters
alpha (Tuple[float, float]) –
Blending factor of the sharpened image. A random value will be sampled from the interval for every image.
Default is
(0.0, 0.2).lightness (Tuple[float, float]) –
Lightness/brightness of the sharped image. A random value will be sampled from the interval per image.
Default is
(0.8, 1.2).
- class SomeOf(*args: Any, **kwargs: Any)[source]¶
Bases:
AugmentationListA list of
Augmentationsonly some will be used of.Randomly chooses
Augmentationfrom the given list within the range of possible numbers ofAugmentation‘s.- Parameters
augments (List[Augmentation]) – List of possible augmentations to choose from.
lower (int) – Minimum amount of augmentations to choose.
upper (int) – Maximum amount of augmentations to choose.