-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Update docs to mention rotated boxes and keypoints #9113
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
Open
NicolasHug
wants to merge
1
commit into
pytorch:main
Choose a base branch
from
NicolasHug:kpdocs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
.. _transforms: | ||
|
||
Transforming and augmenting images | ||
================================== | ||
Transforming images, videos, boxes and more | ||
=========================================== | ||
|
||
.. currentmodule:: torchvision.transforms | ||
|
||
Torchvision supports common computer vision transformations in the | ||
``torchvision.transforms`` and ``torchvision.transforms.v2`` modules. Transforms | ||
can be used to transform or augment data for training or inference of different | ||
tasks (image classification, detection, segmentation, video classification). | ||
``torchvision.transforms.v2`` module. Transforms can be used to transform and | ||
augment data, for both training or inference. The following objects are | ||
supported: | ||
|
||
- Images as pure tensors, :class:`~torchvision.tv_tensors.Image` or PIL image | ||
- Videos as :class:`~torchvision.tv_tensors.Video` | ||
- Aligned and rotated bounding boxes as :class:`~torchvision.tv_tensors.BoundingBoxes` | ||
- Segmentation and detection masks as :class:`~torchvision.tv_tensors.Mask` | ||
- KeyPoints as :class:`~torchvision.tv_tensors.KeyPoints`. | ||
|
||
.. code:: python | ||
|
||
|
@@ -111,9 +117,9 @@ In Torchvision 0.15 (March 2023), we released a new set of transforms available | |
in the ``torchvision.transforms.v2`` namespace. These transforms have a lot of | ||
advantages compared to the v1 ones (in ``torchvision.transforms``): | ||
|
||
- They can transform images **but also** bounding boxes, masks, or videos. This | ||
provides support for tasks beyond image classification: detection, segmentation, | ||
video classification, etc. See | ||
- They can transform images **but also** bounding boxes, masks, videos and | ||
keypoints. This provides support for tasks beyond image classification: | ||
detection, segmentation, video classification, etc. See | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add "pose estimation"? |
||
:ref:`sphx_glr_auto_examples_transforms_plot_transforms_getting_started.py` | ||
and :ref:`sphx_glr_auto_examples_transforms_plot_transforms_e2e.py`. | ||
- They support more transforms like :class:`~torchvision.transforms.v2.CutMix` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,12 +79,12 @@ | |
# very easy: the v2 transforms are fully compatible with the v1 API, so you | ||
# only need to change the import! | ||
# | ||
# Detection, Segmentation, Videos | ||
# Videos, boxes, masks, keypoints | ||
# ------------------------------- | ||
# | ||
# The new Torchvision transforms in the ``torchvision.transforms.v2`` namespace | ||
# support tasks beyond image classification: they can also transform bounding | ||
# boxes, segmentation / detection masks, or videos. | ||
# The Torchvision transforms in the ``torchvision.transforms.v2`` namespace | ||
# support tasks beyond image classification: they can also transform rotated or | ||
# aligned bounding boxes, segmentation / detection masks, videos, and keypoints. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe "axis-aligned"? |
||
# | ||
# Let's briefly look at a detection example with bounding boxes. | ||
|
||
|
@@ -129,8 +129,9 @@ | |
# TVTensors are :class:`torch.Tensor` subclasses. The available TVTensors are | ||
# :class:`~torchvision.tv_tensors.Image`, | ||
# :class:`~torchvision.tv_tensors.BoundingBoxes`, | ||
# :class:`~torchvision.tv_tensors.Mask`, and | ||
# :class:`~torchvision.tv_tensors.Video`. | ||
# :class:`~torchvision.tv_tensors.Mask`, | ||
# :class:`~torchvision.tv_tensors.Video`, and | ||
# :class:`~torchvision.tv_tensors.KeyPoints`. | ||
# | ||
# TVTensors look and feel just like regular tensors - they **are** tensors. | ||
# Everything that is supported on a plain :class:`torch.Tensor` like ``.sum()`` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Axis-aligned" to be a bit more specific?