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
f5dca445
Unverified
Commit
f5dca445
authored
Dec 16, 2021
by
Sumanth Ratna
Committed by
GitHub
Dec 16, 2021
Browse files
Fix `draw_keypoints` for tensors on GPU (#5102)
parent
582d12a1
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 @
f5dca445
...
@@ -346,7 +346,7 @@ def draw_keypoints(
...
@@ -346,7 +346,7 @@ def draw_keypoints(
if
keypoints
.
ndim
!=
3
:
if
keypoints
.
ndim
!=
3
:
raise
ValueError
(
"keypoints must be of shape (num_instances, K, 2)"
)
raise
ValueError
(
"keypoints must be of shape (num_instances, K, 2)"
)
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
)
draw
=
ImageDraw
.
Draw
(
img_to_draw
)
draw
=
ImageDraw
.
Draw
(
img_to_draw
)
img_kpts
=
keypoints
.
to
(
torch
.
int64
).
tolist
()
img_kpts
=
keypoints
.
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