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
455eda68
Unverified
Commit
455eda68
authored
Jan 27, 2023
by
Philip Meier
Committed by
GitHub
Jan 27, 2023
Browse files
fix Resize for JIT single value sequences (#7139)
parent
1496ff0c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
test/test_prototype_transforms_consistency.py
test/test_prototype_transforms_consistency.py
+1
-0
torchvision/prototype/transforms/_geometry.py
torchvision/prototype/transforms/_geometry.py
+10
-5
No files found.
test/test_prototype_transforms_consistency.py
View file @
455eda68
...
...
@@ -74,6 +74,7 @@ CONSISTENCY_CONFIGS = [
legacy_transforms
.
Resize
,
[
ArgsKwargs
(
32
),
ArgsKwargs
([
32
]),
ArgsKwargs
((
32
,
29
)),
ArgsKwargs
((
31
,
28
),
interpolation
=
prototype_transforms
.
InterpolationMode
.
NEAREST
),
ArgsKwargs
((
33
,
26
),
interpolation
=
prototype_transforms
.
InterpolationMode
.
BICUBIC
),
...
...
torchvision/prototype/transforms/_geometry.py
View file @
455eda68
...
...
@@ -46,11 +46,16 @@ class Resize(Transform):
)
->
None
:
super
().
__init__
()
self
.
size
=
(
[
size
]
if
isinstance
(
size
,
int
)
else
_setup_size
(
size
,
error_msg
=
"Please provide only two dimensions (h, w) for size."
)
if
isinstance
(
size
,
int
):
size
=
[
size
]
elif
isinstance
(
size
,
(
list
,
tuple
))
and
len
(
size
)
in
{
1
,
2
}:
size
=
list
(
size
)
else
:
raise
ValueError
(
f
"size can either be an integer or a list or tuple of one or two integers, "
f
"but got
{
size
}
instead."
)
self
.
size
=
size
self
.
interpolation
=
interpolation
self
.
max_size
=
max_size
self
.
antialias
=
antialias
...
...
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