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
3a0e028f
Unverified
Commit
3a0e028f
authored
Feb 14, 2023
by
Nicolas Hug
Committed by
GitHub
Feb 14, 2023
Browse files
Use `is False` for some antialias checks (#7234)
parent
20f84bfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
torchvision/prototype/transforms/functional/_geometry.py
torchvision/prototype/transforms/functional/_geometry.py
+1
-1
torchvision/transforms/functional.py
torchvision/transforms/functional.py
+1
-1
No files found.
torchvision/prototype/transforms/functional/_geometry.py
View file @
3a0e028f
...
@@ -249,7 +249,7 @@ def resize(
...
@@ -249,7 +249,7 @@ def resize(
elif
isinstance
(
inpt
,
datapoints
.
_datapoint
.
Datapoint
):
elif
isinstance
(
inpt
,
datapoints
.
_datapoint
.
Datapoint
):
return
inpt
.
resize
(
size
,
interpolation
=
interpolation
,
max_size
=
max_size
,
antialias
=
antialias
)
return
inpt
.
resize
(
size
,
interpolation
=
interpolation
,
max_size
=
max_size
,
antialias
=
antialias
)
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
if
antialias
is
not
None
and
not
antialias
:
if
antialias
is
False
:
warnings
.
warn
(
"Anti-alias option is always applied for PIL Image input. Argument antialias is ignored."
)
warnings
.
warn
(
"Anti-alias option is always applied for PIL Image input. Argument antialias is ignored."
)
return
resize_image_pil
(
inpt
,
size
,
interpolation
=
interpolation
,
max_size
=
max_size
)
return
resize_image_pil
(
inpt
,
size
,
interpolation
=
interpolation
,
max_size
=
max_size
)
else
:
else
:
...
...
torchvision/transforms/functional.py
View file @
3a0e028f
...
@@ -484,7 +484,7 @@ def resize(
...
@@ -484,7 +484,7 @@ def resize(
antialias
=
_check_antialias
(
img
,
antialias
,
interpolation
)
antialias
=
_check_antialias
(
img
,
antialias
,
interpolation
)
if
not
isinstance
(
img
,
torch
.
Tensor
):
if
not
isinstance
(
img
,
torch
.
Tensor
):
if
antialias
is
not
None
and
not
antialias
:
if
antialias
is
False
:
warnings
.
warn
(
"Anti-alias option is always applied for PIL Image input. Argument antialias is ignored."
)
warnings
.
warn
(
"Anti-alias option is always applied for PIL Image input. Argument antialias is ignored."
)
pil_interpolation
=
pil_modes_mapping
[
interpolation
]
pil_interpolation
=
pil_modes_mapping
[
interpolation
]
return
F_pil
.
resize
(
img
,
size
=
output_size
,
interpolation
=
pil_interpolation
)
return
F_pil
.
resize
(
img
,
size
=
output_size
,
interpolation
=
pil_interpolation
)
...
...
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