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
d010e82f
Unverified
Commit
d010e82f
authored
Feb 15, 2023
by
Philip Meier
Committed by
GitHub
Feb 15, 2023
Browse files
fix ten_crop datapoint return (#7260)
parent
30bb1cea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/prototype/transforms/functional/_geometry.py
torchvision/prototype/transforms/functional/_geometry.py
+2
-2
No files found.
torchvision/prototype/transforms/functional/_geometry.py
View file @
d010e82f
...
@@ -2089,10 +2089,10 @@ def ten_crop(
...
@@ -2089,10 +2089,10 @@ def ten_crop(
return
ten_crop_image_tensor
(
inpt
,
size
,
vertical_flip
=
vertical_flip
)
return
ten_crop_image_tensor
(
inpt
,
size
,
vertical_flip
=
vertical_flip
)
elif
isinstance
(
inpt
,
datapoints
.
Image
):
elif
isinstance
(
inpt
,
datapoints
.
Image
):
output
=
ten_crop_image_tensor
(
inpt
.
as_subclass
(
torch
.
Tensor
),
size
,
vertical_flip
=
vertical_flip
)
output
=
ten_crop_image_tensor
(
inpt
.
as_subclass
(
torch
.
Tensor
),
size
,
vertical_flip
=
vertical_flip
)
return
[
datapoints
.
Image
.
wrap_like
(
inpt
,
item
)
for
item
in
output
]
return
tuple
(
datapoints
.
Image
.
wrap_like
(
inpt
,
item
)
for
item
in
output
)
# type: ignore[return-value
]
elif
isinstance
(
inpt
,
datapoints
.
Video
):
elif
isinstance
(
inpt
,
datapoints
.
Video
):
output
=
ten_crop_video
(
inpt
.
as_subclass
(
torch
.
Tensor
),
size
,
vertical_flip
=
vertical_flip
)
output
=
ten_crop_video
(
inpt
.
as_subclass
(
torch
.
Tensor
),
size
,
vertical_flip
=
vertical_flip
)
return
[
datapoints
.
Video
.
wrap_like
(
inpt
,
item
)
for
item
in
output
]
return
tuple
(
datapoints
.
Video
.
wrap_like
(
inpt
,
item
)
for
item
in
output
)
# type: ignore[return-value
]
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
elif
isinstance
(
inpt
,
PIL
.
Image
.
Image
):
return
ten_crop_image_pil
(
inpt
,
size
,
vertical_flip
=
vertical_flip
)
return
ten_crop_image_pil
(
inpt
,
size
,
vertical_flip
=
vertical_flip
)
else
:
else
:
...
...
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