Transforms are common image transformations. They can be chained together using :class:`Compose`.
Transforms are common image transformations available in the
``torchvision.transforms`` module. They can be chained together using
:class:`Compose`.
Most transform classes have a function equivalent: :ref:`functional
transforms <functional_transforms>` give fine-grained control over the
transformations.
...
...
@@ -90,131 +92,94 @@ For any custom transformations to be used with ``torch.jit.script``, they should
Compositions of transforms
--------------------------
.. autoclass:: Compose
.. autosummary::
:toctree: generated/
:template: class.rst
Compose
Transforms on PIL Image and torch.\*Tensor
------------------------------------------
.. autoclass:: CenterCrop
:members:
.. autoclass:: ColorJitter
:members:
.. autoclass:: FiveCrop
:members:
.. autoclass:: Grayscale
:members:
.. autoclass:: Pad
:members:
.. autoclass:: RandomAffine
:members:
.. autoclass:: RandomApply
.. autoclass:: RandomCrop
:members:
.. autoclass:: RandomGrayscale
:members:
.. autoclass:: RandomHorizontalFlip
:members:
.. autoclass:: RandomPerspective
:members:
.. autoclass:: RandomResizedCrop
:members:
.. autoclass:: RandomRotation
:members:
.. autoclass:: RandomSizedCrop
:members:
.. autoclass:: RandomVerticalFlip
:members:
.. autoclass:: Resize
:members:
.. autoclass:: Scale
:members:
.. autosummary::
:toctree: generated/
:template: class.rst
CenterCrop
ColorJitter
FiveCrop
Grayscale
Pad
RandomAffine
RandomApply
RandomCrop
RandomGrayscale
RandomHorizontalFlip
RandomPerspective
RandomResizedCrop
RandomRotation
RandomSizedCrop
RandomVerticalFlip
Resize
TenCrop
GaussianBlur
RandomInvert
RandomPosterize
RandomSolarize
RandomAdjustSharpness
RandomAutocontrast
RandomEqualize
.. autoclass:: TenCrop
:members:
.. autoclass:: GaussianBlur
:members:
.. autoclass:: RandomInvert
:members:
.. autoclass:: RandomPosterize
:members:
.. autoclass:: RandomSolarize
:members:
.. autoclass:: RandomAdjustSharpness
:members:
.. autoclass:: RandomAutocontrast
:members:
.. autoclass:: RandomEqualize
:members:
.. _transforms_pil_only:
Transforms on PIL Image only
----------------------------
.. autoclass:: RandomChoice
.. autosummary::
:toctree: generated/
:template: class.rst
.. autoclass:: RandomOrder
RandomChoice
RandomOrder
.. _transforms_tensor_only:
Transforms on torch.\*Tensor only
---------------------------------
.. autoclass:: LinearTransformation
:members:
.. autoclass:: Normalize
:members:
.. autosummary::
:toctree: generated/
:template: class.rst
.. autoclass:: RandomErasing
:members:
.. autoclass:: ConvertImageDtype
LinearTransformation
Normalize
RandomErasing
ConvertImageDtype
.. _conversion_transforms:
Conversion Transforms
---------------------
.. autoclass:: ToPILImage
:members:
.. autoclass:: ToTensor
:members:
.. autosummary::
:toctree: generated/
:template: class.rst
.. autoclass:: PILToTensor
:members:
ToPILImage
ToTensor
PILToTensor
Generic Transforms
------------------
.. autoclass:: Lambda
:members:
.. autosummary::
:toctree: generated/
:template: class.rst
Lambda
Automatic Augmentation Transforms
...
...
@@ -226,27 +191,22 @@ ImageNet policies provide significant improvements when applied to other dataset
In TorchVision we implemented 3 policies learned on the following datasets: ImageNet, CIFAR10 and SVHN.
The new transform can be used standalone or mixed-and-matched with existing transforms:
.. autoclass:: AutoAugmentPolicy
:members:
.. autoclass:: AutoAugment
:members:
.. autosummary::
:toctree: generated/
:template: class.rst
`RandAugment <https://arxiv.org/abs/1909.13719>`_ is a simple high-performing Data Augmentation technique which improves the accuracy of Image Classification models.
.. autoclass:: RandAugment
:members:
`TrivialAugmentWide <https://arxiv.org/abs/2103.10158>`_ is a dataset-independent data-augmentation technique which improves the accuracy of Image Classification models.