Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
85fcea62
Unverified
Commit
85fcea62
authored
Mar 18, 2021
by
Nicolas Hug
Committed by
GitHub
Mar 18, 2021
Browse files
Clarify docstring of RandomResizedCrop (#3584)
parent
c00c4d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+9
-8
No files found.
torchvision/transforms/transforms.py
View file @
85fcea62
...
@@ -773,22 +773,23 @@ class RandomPerspective(torch.nn.Module):
...
@@ -773,22 +773,23 @@ class RandomPerspective(torch.nn.Module):
class
RandomResizedCrop
(
torch
.
nn
.
Module
):
class
RandomResizedCrop
(
torch
.
nn
.
Module
):
"""Crop the given image to random size and aspect ratio.
"""Crop a random portion of image and resize it to a given size.
If the image is torch Tensor, it is expected
If the image is torch Tensor, it is expected
to have [..., H, W] shape, where ... means an arbitrary number of leading dimensions
to have [..., H, W] shape, where ... means an arbitrary number of leading dimensions
A crop of random size (default: of 0.08 to 1.0) of the original size and a random
A crop of the original image is made: the crop has a random area (H * W)
aspect ratio (default: of 3/4 to 4/3) of the original aspect ratio is made. This crop
and a random aspect ratio. This crop is finally resized to the given
is finally resized to given size.
size. This is popularly used to train the Inception networks.
This is popularly used to train the Inception networks.
Args:
Args:
size (int or sequence): expected output size of each edge. If size is an
size (int or sequence): expected output size of
the crop, for
each edge. If size is an
int instead of sequence like (h, w), a square output size ``(size, size)`` is
int instead of sequence like (h, w), a square output size ``(size, size)`` is
made. If provided a sequence of length 1, it will be interpreted as (size[0], size[0]).
made. If provided a sequence of length 1, it will be interpreted as (size[0], size[0]).
In torchscript mode size as single int is not supported, use a sequence of length 1: ``[size, ]``.
In torchscript mode size as single int is not supported, use a sequence of length 1: ``[size, ]``.
scale (tuple of float): scale range of the cropped image before resizing, relatively to the origin image.
scale (tuple of float): lower and upper bounds for the random area of the crop, before resizing.
ratio (tuple of float): aspect ratio range of the cropped image before resizing.
ratio (tuple of float): lower and upper bounds for the random aspect ratio of the crop, before
resizing.
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` and
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` and
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment