brails.processors.FoundationClassifier.lib.custom_transforms module
- class brails.processors.FoundationClassifier.lib.custom_transforms.AddGaussianNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Add gaussian noise to a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.AddGaussianPoissonNoise(sigma, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Add poisson noise with gaussian blurred image to a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.AddSpeckleNoise(mean, sigma, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Add speckle noise to a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.BilinearResize(zoom)
Bases:
object
Resize a PIL.Image or numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.CenterCropNumpy(size)
Bases:
object
Crops the given numpy array at the center to have a region of the given size. size can be a tuple (target_height, target_width) or an integer, in which case the target will be of a square shape (size, size)
- class brails.processors.FoundationClassifier.lib.custom_transforms.ElasticTransform(alpha, sigma)
Bases:
object
Apply elastic transformation on a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.EnhancedCompose(transforms)
Bases:
object
Composes several transforms together. Args:
transforms (List[Transform]): list of transforms to compose.
- Example:
>>> transforms.Compose([ >>> transforms.CenterCrop(10), >>> transforms.ToTensor(), >>> ])
- class brails.processors.FoundationClassifier.lib.custom_transforms.MaxScaleNumpy(range_min=0.0, range_max=1.0)
Bases:
object
scale with max and min of each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.FoundationClassifier.lib.custom_transforms.MedianScaleNumpy(range_min=0.0, range_max=1.0)
Bases:
object
Scale with median and mean of each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.FoundationClassifier.lib.custom_transforms.Merge(axis=-1)
Bases:
object
Merge a group of images
- class brails.processors.FoundationClassifier.lib.custom_transforms.MutualExclude(exclude_channel, from_channel)
Bases:
object
Remove elements from one channel
- class brails.processors.FoundationClassifier.lib.custom_transforms.NormalizeNumpy
Bases:
object
Normalize each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.FoundationClassifier.lib.custom_transforms.PoissonSubsampling(peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Poisson subsampling on a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.RandomCropNumpy(size, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Crops the given numpy array at a random location to have a region of the given size. size can be a tuple (target_height, target_width) or an integer, in which case the target will be of a square shape (size, size)
- class brails.processors.FoundationClassifier.lib.custom_transforms.RandomGaussianBlurring(sigma, p=0.2, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Apply gaussian blur to a numpy.ndarray (H x W x C)
- class brails.processors.FoundationClassifier.lib.custom_transforms.RandomRotate(angle_range=(0.0, 360.0), axes=(0, 1), mode='reflect', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
object
Rotate a PIL.Image or numpy.ndarray (H x W x C) randomly
- class brails.processors.FoundationClassifier.lib.custom_transforms.Split(*slices, **kwargs)
Bases:
object
Split images into individual arrays
- brails.processors.FoundationClassifier.lib.custom_transforms.center_crop(x, center_crop_size)
- brails.processors.FoundationClassifier.lib.custom_transforms.elastic_transform(image, alpha=1000, sigma=30, spline_order=1, mode='nearest', random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Elastic deformation of image as described in [Simard2003]. .. [Simard2003] Simard, Steinkraus and Platt, “Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis”, in Proc. of the International Conference on Document Analysis and Recognition, 2003.
- brails.processors.FoundationClassifier.lib.custom_transforms.poisson_downsampling(image, peak, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
- brails.processors.FoundationClassifier.lib.custom_transforms.random_num_generator(config, random_state=<module 'numpy.random' from '/Users/fmckenna/python_env/brails++3.10/lib/python3.10/site-packages/numpy/random/__init__.py'>)
- brails.processors.FoundationClassifier.lib.custom_transforms.to_tensor(x)