Torch Preprocessors
Torch transformers
TorchCenterCrop(size)
Bases: TorchBuiltInTransformer
Class that implements the CenterCrop Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer CenterCrop directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
113 114 |
|
TorchColorJitter(brightness=0, contrast=0, saturation=0, hue=0)
Bases: TorchBuiltInTransformer
Class that implements the ColorJitter Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer ColorJitter directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
315 316 |
|
TorchCompose(transforms_list)
Bases: TorchBuiltInTransformer
Class that implements the Compose Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Compose directly from torchvision.
TorchVision documentation: here
The only difference w.r.t. the TorchVision implementation is that while the original implementation expects a list of Transformer objects as parameter, this implementation expects a list of ImageProcessor (so other image pre-processors) as parameter
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
88 89 |
|
TorchConvertImageDtype(dtype)
Bases: TorchBuiltInTransformer
Class that implements the ConvertImageDtype Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer ConvertImageDtype directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
100 101 |
|
TorchGaussianBlur(kernel_size, sigma=(0.1, 2.0))
Bases: TorchBuiltInTransformer
Class that implements the GaussianBlur Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer GaussianBlur directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
139 140 |
|
TorchGrayscale(num_output_channels=1)
Bases: TorchBuiltInTransformer
Class that implements the Grayscale Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Grayscale directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
126 127 |
|
TorchLambda(lambd)
Bases: TorchBuiltInTransformer
Class that implements the Lambda Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Lambda directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
165 166 |
|
TorchLinearTransformation(transformation_matrix, mean_vector)
Bases: TorchBuiltInTransformer
Class that implements the LinearTransformation Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer LinearTransformation directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
303 304 |
|
TorchNormalize(mean, std)
Bases: TorchBuiltInTransformer
Class that implements the Normalize Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Normalize directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
152 153 |
|
TorchPad(padding, fill=0, padding_mode='constant')
Bases: TorchBuiltInTransformer
Class that implements the Pad Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Pad directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
178 179 |
|
TorchRandomAdjustSharpness(sharpness_factor, p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomAdjustSharpness Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomAdjustSharpness directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
429 430 |
|
TorchRandomAffine(degrees, translate=None, scale=None, shear=None, interpolation=InterpolationMode.NEAREST, fill=0, center=None)
Bases: TorchBuiltInTransformer
Class that implements the RandomAffine Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomAffine directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
340 341 342 343 344 |
|
TorchRandomApply(transforms_list, p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomApply Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomApply directly from torchvision.
TorchVision documentation: here
The only difference w.r.t. the TorchVision implementation is that while the original implementation expects a list of Transformer objects as parameter, this implementation expects a list of ImageProcessor (so other image pre-processors) as parameter
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
195 196 |
|
TorchRandomAutocontrast(p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomAutocontrast Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomAutocontrast directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
441 442 |
|
TorchRandomChoice(transforms_list, p=None)
Bases: TorchBuiltInTransformer
Class that implements the RandomChoice Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomChoice directly from torchvision.
TorchVision documentation: here
The only difference w.r.t. the TorchVision implementation is that while the original implementation expects a list of Transformer objects as parameter, this implementation expects a list of ImageProcessor (so other image pre-processors) as parameter
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
212 213 |
|
TorchRandomCrop(size, padding=None, pad_if_needed=False, fill=0, padding_mode='constant')
Bases: TorchBuiltInTransformer
Class that implements the RandomCrop Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomCrop directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
240 241 242 |
|
TorchRandomEqualize(p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomEqualize Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomEqualize directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
453 454 |
|
TorchRandomErasing(p=0.5, scale=(0.02, 0.33), ratio=(0.3, 3.3), value=0, inplace=False)
Bases: TorchBuiltInTransformer
Class that implements the RandomErasing Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomErasing directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
380 381 382 |
|
TorchRandomGrayscale(p=0.1)
Bases: TorchBuiltInTransformer
Class that implements the RandomGrayscale Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomGrayscale directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
355 356 |
|
TorchRandomHorizontalFlip(p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomHorizontalFlip Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomHorizontalFlip directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
253 254 |
|
TorchRandomInvert(p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomInvert Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomInvert directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
393 394 |
|
TorchRandomOrder(transforms_list)
Bases: TorchBuiltInTransformer
Class that implements the RandomOrder Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomOrder directly from torchvision.
TorchVision documentation: here
The only difference w.r.t. the TorchVision implementation is that while the original implementation expects a list of Transformer objects as parameter, this implementation expects a list of ImageProcessor (so other image pre-processors) as parameter
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
228 229 |
|
TorchRandomPerspective(distortion_scale=0.5, p=0.5, interpolation=InterpolationMode.BILINEAR, fill=0)
Bases: TorchBuiltInTransformer
Class that implements the RandomPerspective Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomPerspective directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
367 368 369 |
|
TorchRandomPosterize(bits, p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomPosterize Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomPosterize directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
405 406 |
|
TorchRandomResizedCrop(size, scale=(0.08, 1.0), ratio=(3.0 / 4.0, 4.0 / 3.0), interpolation=InterpolationMode.BILINEAR, antialias=None)
Bases: TorchBuiltInTransformer
Class that implements the RandomResizedCrop Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomResizedCrop directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
277 278 279 |
|
TorchRandomRotation(degrees, interpolation=InterpolationMode.NEAREST, expand=False, center=None, fill=0)
Bases: TorchBuiltInTransformer
Class that implements the RandomRotation Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomRotation directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
327 328 329 |
|
TorchRandomSolarize(threshold, p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomSolarize Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomSolarize directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
417 418 |
|
TorchRandomVerticalFlip(p=0.5)
Bases: TorchBuiltInTransformer
Class that implements the RandomVerticalFlip Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandomVerticalFlip directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
265 266 |
|
TorchResize(size, interpolation=InterpolationMode.BILINEAR, max_size=None, antialias=None)
Bases: TorchBuiltInTransformer
Class that implements the Resize Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer Resize directly from torchvision.
TorchVision documentation: here
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_transformer.py
290 291 292 |
|
Torch augmenters
TorchAutoAugment(policy=AutoAugmentPolicy.IMAGENET, interpolation=InterpolationMode.NEAREST, fill=None)
Bases: TorchBuiltInTransformer
Class that implements the AutoAugment Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer AutoAugment directly from torchvision.
TorchVision documentation: here
NOTE: the augmented result will SUBSTITUTE the original input
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_augmenter.py
29 30 31 32 33 |
|
TorchRandAugment(num_ops=2, magnitude=9, num_magnitude_bins=31, interpolation=InterpolationMode.NEAREST, fill=None)
Bases: TorchBuiltInTransformer
Class that implements the RandAugment Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer RandAugment directly from torchvision.
TorchVision documentation: here
NOTE: the augmented result will SUBSTITUTE the original input
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_augmenter.py
46 47 48 49 50 51 52 53 54 |
|
TorchTrivialAugmentWide(num_magnitude_bins=31, interpolation=InterpolationMode.NEAREST, fill=None)
Bases: TorchBuiltInTransformer
Class that implements the TrivialAugmentWide Transformer from torchvision. The parameters one could pass are the same ones you would pass instantiating the transformer TrivialAugmentWide directly from torchvision.
TorchVision documentation: here
NOTE: the augmented result will SUBSTITUTE the original input
Source code in clayrs/content_analyzer/information_processor/visual_preprocessors/torch_builtin_augmenter.py
67 68 69 70 71 72 73 |
|