From b1107edfcf1a406619202aa1f76660ebed24c8a3 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 24 Feb 2023 14:37:25 +0000 Subject: [PATCH 1/2] Add docs for functionals v2 --- docs/source/transforms.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/source/transforms.rst b/docs/source/transforms.rst index 6957e79bbfa..5daa2a9efe1 100644 --- a/docs/source/transforms.rst +++ b/docs/source/transforms.rst @@ -5,6 +5,22 @@ Transforming and augmenting images .. currentmodule:: torchvision.transforms + +.. note:: + In 0.15, we released a new set of transforms available in the + ``torchvision.transforms.v2`` namespace, which add suppotr for transforming + not just images but also bounding boxes, masks, or videos. These transforms + are fully backward compatible with the current ones, and you'll see them + documented below with a `v2.` prefix. To get started with those new + transforms, you can check out + :ref:`sphx_glr_auto_examples_plot_transforms_v2_e2e.py`. + Note that these transforms are still BETA, and while we don't expect major + breaking changes in the future, some APIs may still change according to user + feedback. Please submit any feedback you may have in + https://github.com/pytorch/vision/issues/6753, and you can also check out + https://github.com/pytorch/vision/issues/7319 to learn more about the APIs + that we suspect might involve future changes. + Transforms are common image transformations available in the ``torchvision.transforms`` module. They can be chained together using :class:`Compose`. @@ -253,6 +269,14 @@ Functional Transforms .. currentmodule:: torchvision.transforms.functional + +.. note:: + You'll find below the documentation for the existing + ``torchvision.transforms.functional`` namespace. The + ``torchvision.transforms.v2.functional`` namespace exists as well and can be + used! The same functionals are present, so you simply need to change your + import to rely on the ``v2`` namespace. + Functional transforms give you fine-grained control of the transformation pipeline. As opposed to the transformations above, functional transforms don't contain a random number generator for their parameters. From 3b5f08c945f4e58d38c5479633c86ce93167ed50 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 24 Feb 2023 14:44:52 +0000 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Philip Meier --- docs/source/transforms.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/transforms.rst b/docs/source/transforms.rst index 5daa2a9efe1..22e0889a480 100644 --- a/docs/source/transforms.rst +++ b/docs/source/transforms.rst @@ -8,8 +8,8 @@ Transforming and augmenting images .. note:: In 0.15, we released a new set of transforms available in the - ``torchvision.transforms.v2`` namespace, which add suppotr for transforming - not just images but also bounding boxes, masks, or videos. These transforms + ``torchvision.transforms.v2`` namespace, which add support for transforming + not just images but also bounding boxes, masks, or videos. These transforms are fully backward compatible with the current ones, and you'll see them documented below with a `v2.` prefix. To get started with those new transforms, you can check out