Skip to content

Add docs for functionals v2 #7328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
: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`.
Expand Down Expand Up @@ -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.
Expand Down