brails.processors.foundation_classifier.lib.custom_transforms module
- class brails.processors.foundation_classifier.lib.custom_transforms.AddGaussianNoise(mean, sigma, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectAdd gaussian noise to a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.AddGaussianPoissonNoise(sigma, peak, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectAdd poisson noise with gaussian blurred image to a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.AddSpeckleNoise(mean, sigma, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectAdd speckle noise to a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.BilinearResize(zoom)
Bases:
objectResize a PIL.Image or numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.CenterCropNumpy(size)
Bases:
objectCrops 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.foundation_classifier.lib.custom_transforms.ElasticTransform(alpha, sigma)
Bases:
objectApply elastic transformation on a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.EnhancedCompose(transforms)
Bases:
objectComposes several transforms together. :param transforms: list of transforms to compose. :type transforms: List[Transform]
Example
>>> transforms.Compose([ >>> transforms.CenterCrop(10), >>> transforms.ToTensor(), >>> ])
- class brails.processors.foundation_classifier.lib.custom_transforms.MaxScaleNumpy(range_min=0.0, range_max=1.0)
Bases:
objectscale with max and min of each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.foundation_classifier.lib.custom_transforms.MedianScaleNumpy(range_min=0.0, range_max=1.0)
Bases:
objectScale with median and mean of each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.foundation_classifier.lib.custom_transforms.Merge(axis=-1)
Bases:
objectMerge a group of images
- class brails.processors.foundation_classifier.lib.custom_transforms.MutualExclude(exclude_channel, from_channel)
Bases:
objectRemove elements from one channel
- class brails.processors.foundation_classifier.lib.custom_transforms.NormalizeNumpy
Bases:
objectNormalize each channel of the numpy array i.e. channel = (channel - mean) / std
- class brails.processors.foundation_classifier.lib.custom_transforms.PoissonSubsampling(peak, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectPoisson subsampling on a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.RandomCropNumpy(size, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectCrops 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.foundation_classifier.lib.custom_transforms.RandomGaussianBlurring(sigma, p=0.2, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectApply gaussian blur to a numpy.ndarray (H x W x C)
- class brails.processors.foundation_classifier.lib.custom_transforms.RandomRotate(angle_range=(0.0, 360.0), axes=(0, 1), mode='reflect', random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
Bases:
objectRotate a PIL.Image or numpy.ndarray (H x W x C) randomly
- class brails.processors.foundation_classifier.lib.custom_transforms.Split(*slices, **kwargs)
Bases:
objectSplit images into individual arrays
- brails.processors.foundation_classifier.lib.custom_transforms.center_crop(x, center_crop_size)
- brails.processors.foundation_classifier.lib.custom_transforms.elastic_transform(image, alpha=1000, sigma=30, spline_order=1, mode='nearest', random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/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.foundation_classifier.lib.custom_transforms.poisson_downsampling(image, peak, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
- brails.processors.foundation_classifier.lib.custom_transforms.random_num_generator(config, random_state=<module 'numpy.random' from '/home/bacetiner/anaconda3/envs/brails-pip/lib/python3.10/site-packages/numpy/random/__init__.py'>)
- brails.processors.foundation_classifier.lib.custom_transforms.to_tensor(x)