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
4433a5b2
Unverified
Commit
4433a5b2
authored
Jul 08, 2020
by
vfdev
Committed by
GitHub
Jul 08, 2020
Browse files
Minor docs improvement (#2403)
* Minor docs improvement * Replaced link by already defined `filters`_
parent
9b804659
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
torchvision/transforms/functional.py
torchvision/transforms/functional.py
+7
-3
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+6
-2
No files found.
torchvision/transforms/functional.py
View file @
4433a5b2
...
@@ -311,7 +311,7 @@ def normalize(tensor, mean, std, inplace=False):
...
@@ -311,7 +311,7 @@ def normalize(tensor, mean, std, inplace=False):
return
tensor
return
tensor
def
resize
(
img
:
Tensor
,
size
:
List
[
int
],
interpolation
:
int
=
2
)
->
Tensor
:
def
resize
(
img
:
Tensor
,
size
:
List
[
int
],
interpolation
:
int
=
Image
.
BILINEAR
)
->
Tensor
:
r
"""Resize the input image to the given size.
r
"""Resize the input image to the given size.
The image can be a PIL Image or a torch Tensor, in which case it is expected
The image can be a PIL Image or a torch Tensor, in which case 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
...
@@ -325,7 +325,9 @@ def resize(img: Tensor, size: List[int], interpolation: int = 2) -> Tensor:
...
@@ -325,7 +325,9 @@ def resize(img: Tensor, size: List[int], interpolation: int = 2) -> Tensor:
:math:`\left(\text{size} \times \frac{\text{height}}{\text{width}}, \text{size}\right)`.
:math:`\left(\text{size} \times \frac{\text{height}}{\text{width}}, \text{size}\right)`.
In torchscript mode padding as single int is not supported, use a tuple or
In torchscript mode padding as single int is not supported, use a tuple or
list of length 1: ``[size, ]``.
list of length 1: ``[size, ]``.
interpolation (int, optional): Desired interpolation. Default is bilinear.
interpolation (int, optional): Desired interpolation enum defined by `filters`_.
Default is ``PIL.Image.BILINEAR``. If input is Tensor, only ``PIL.Image.NEAREST``, ``PIL.Image.BILINEAR``
and ``PIL.Image.BICUBIC`` are supported.
Returns:
Returns:
PIL Image or Tensor: Resized image.
PIL Image or Tensor: Resized image.
...
@@ -455,7 +457,9 @@ def resized_crop(
...
@@ -455,7 +457,9 @@ def resized_crop(
height (int): Height of the crop box.
height (int): Height of the crop box.
width (int): Width of the crop box.
width (int): Width of the crop box.
size (sequence or int): Desired output size. Same semantics as ``resize``.
size (sequence or int): Desired output size. Same semantics as ``resize``.
interpolation (int, optional): Desired interpolation. Default is ``PIL.Image.BILINEAR``.
interpolation (int, optional): Desired interpolation enum defined by `filters`_.
Default is ``PIL.Image.BILINEAR``. If input is Tensor, only ``PIL.Image.NEAREST``, ``PIL.Image.BILINEAR``
and ``PIL.Image.BICUBIC`` are supported.
Returns:
Returns:
PIL Image or Tensor: Cropped image.
PIL Image or Tensor: Cropped image.
"""
"""
...
...
torchvision/transforms/transforms.py
View file @
4433a5b2
...
@@ -222,7 +222,9 @@ class Resize(torch.nn.Module):
...
@@ -222,7 +222,9 @@ class Resize(torch.nn.Module):
(size * height / width, size).
(size * height / width, size).
In torchscript mode padding as single int is not supported, use a tuple or
In torchscript mode padding as single int is not supported, use a tuple or
list of length 1: ``[size, ]``.
list of length 1: ``[size, ]``.
interpolation (int, optional): Desired interpolation. Default is ``PIL.Image.BILINEAR``
interpolation (int, optional): Desired interpolation enum defined by `filters`_.
Default is ``PIL.Image.BILINEAR``. If input is Tensor, only ``PIL.Image.NEAREST``, ``PIL.Image.BILINEAR``
and ``PIL.Image.BICUBIC`` are supported.
"""
"""
def
__init__
(
self
,
size
,
interpolation
=
Image
.
BILINEAR
):
def
__init__
(
self
,
size
,
interpolation
=
Image
.
BILINEAR
):
...
@@ -703,7 +705,9 @@ class RandomResizedCrop(torch.nn.Module):
...
@@ -703,7 +705,9 @@ class RandomResizedCrop(torch.nn.Module):
made. If provided a tuple or list of length 1, it will be interpreted as (size[0], size[0]).
made. If provided a tuple or list of length 1, it will be interpreted as (size[0], size[0]).
scale (tuple of float): range of size of the origin size cropped
scale (tuple of float): range of size of the origin size cropped
ratio (tuple of float): range of aspect ratio of the origin aspect ratio cropped.
ratio (tuple of float): range of aspect ratio of the origin aspect ratio cropped.
interpolation (int): Desired interpolation. Default: ``PIL.Image.BILINEAR``
interpolation (int): Desired interpolation enum defined by `filters`_.
Default is ``PIL.Image.BILINEAR``. If input is Tensor, only ``PIL.Image.NEAREST``, ``PIL.Image.BILINEAR``
and ``PIL.Image.BICUBIC`` are supported.
"""
"""
def
__init__
(
self
,
size
,
scale
=
(
0.08
,
1.0
),
ratio
=
(
3.
/
4.
,
4.
/
3.
),
interpolation
=
Image
.
BILINEAR
):
def
__init__
(
self
,
size
,
scale
=
(
0.08
,
1.0
),
ratio
=
(
3.
/
4.
,
4.
/
3.
),
interpolation
=
Image
.
BILINEAR
):
...
...
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