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
582d12a1
Unverified
Commit
582d12a1
authored
Dec 15, 2021
by
Sumanth Ratna
Committed by
GitHub
Dec 15, 2021
Browse files
Fix `draw_bounding_boxes` for tensors on GPU (#5101)
parent
237e0b4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/utils.py
torchvision/utils.py
+1
-1
No files found.
torchvision/utils.py
View file @
582d12a1
...
@@ -189,7 +189,7 @@ def draw_bounding_boxes(
...
@@ -189,7 +189,7 @@ def draw_bounding_boxes(
if
image
.
size
(
0
)
==
1
:
if
image
.
size
(
0
)
==
1
:
image
=
torch
.
tile
(
image
,
(
3
,
1
,
1
))
image
=
torch
.
tile
(
image
,
(
3
,
1
,
1
))
ndarr
=
image
.
permute
(
1
,
2
,
0
).
numpy
()
ndarr
=
image
.
permute
(
1
,
2
,
0
).
cpu
().
numpy
()
img_to_draw
=
Image
.
fromarray
(
ndarr
)
img_to_draw
=
Image
.
fromarray
(
ndarr
)
img_boxes
=
boxes
.
to
(
torch
.
int64
).
tolist
()
img_boxes
=
boxes
.
to
(
torch
.
int64
).
tolist
()
...
...
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