minerva.transforms.random_transform
Classes
A transform that does nothing to the input data. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
|
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them. |
Module Contents
- class minerva.transforms.random_transform.EmptyTransform[source]
Bases:
minerva.transforms.transform._Transform
A transform that does nothing to the input data.
- class minerva.transforms.random_transform.RandomCrop(crop_size, num_samples=1, seed=None, pad_mode='reflect')[source]
Bases:
_RandomSyncedTransform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Parameters
- transform_Transform
A transform that will be applied to the input data.
- num_samplesint
The number of samples that will be transformed.
- seedOptional[int], optional
The seed that will be used to generate the random state, by default None.
- crop_size
- pad_mode = 'reflect'
- Parameters:
crop_size (Tuple[int, int])
num_samples (int)
seed (Optional[int])
pad_mode (str)
- class minerva.transforms.random_transform.RandomFlip(num_samples=1, possible_axis=0, seed=None)[source]
Bases:
_RandomSyncedTransform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
A transform that flips the input data along a random axis.
Parameters
- num_samplesint
The number of samples that will be transformed.
- possible_axisUnion[int, List[int]], optional
Possible axis to be transformed, will be chosen at random, by default 0
- seedOptional[int], optional
A seed to ensure deterministic run, by default None
- possible_axis = 0
- Parameters:
num_samples (int)
possible_axis (Union[int, List[int]])
seed (Optional[int])
- class minerva.transforms.random_transform.RandomGrayScale(num_samples=1, seed=None, prob=0.1, gray=1.0)[source]
Bases:
_RandomSyncedTransform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Parameters
- transform_Transform
A transform that will be applied to the input data.
- num_samplesint
The number of samples that will be transformed.
- seedOptional[int], optional
The seed that will be used to generate the random state, by default None.
- gray = 1.0
- prob = 0.1
- Parameters:
num_samples (int)
seed (Optional[int])
prob (float)
gray (float)
- class minerva.transforms.random_transform.RandomRotation(degrees, prob, num_samples=1, seed=None)[source]
Bases:
_RandomSyncedTransform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Parameters
- transform_Transform
A transform that will be applied to the input data.
- num_samplesint
The number of samples that will be transformed.
- seedOptional[int], optional
The seed that will be used to generate the random state, by default None.
- degrees
- prob
- Parameters:
degrees (float)
prob (float)
num_samples (int)
seed (Optional[int])
- class minerva.transforms.random_transform.RandomSolarize(num_samples=1, seed=None, threshold=128, prob=1.0)[source]
Bases:
_RandomSyncedTransform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Parameters
- transform_Transform
A transform that will be applied to the input data.
- num_samplesint
The number of samples that will be transformed.
- seedOptional[int], optional
The seed that will be used to generate the random state, by default None.
- prob = 1.0
- threshold = 128
- Parameters:
num_samples (int)
seed (Optional[int])
threshold (int)
prob (float)
- class minerva.transforms.random_transform._RandomSyncedTransform(num_samples=1, seed=None)[source]
Bases:
minerva.transforms.transform._Transform
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Orchestrate the application of a type of random transform to a list of data, ensuring that the same random state is used for all of them.
Parameters
- transform_Transform
A transform that will be applied to the input data.
- num_samplesint
The number of samples that will be transformed.
- seedOptional[int], optional
The seed that will be used to generate the random state, by default None.
- __call__(data)[source]
Implement the transformation logic in this method. Usually, the transformation is applied on a single sample of data.
- num_samples = 1
- rng
- transform
- transformations_executed = 0
- Parameters:
num_samples (int)
seed (Optional[int])