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
0bb9b914
Unverified
Commit
0bb9b914
authored
May 22, 2021
by
Vasilis Vryniotis
Committed by
GitHub
May 22, 2021
Browse files
Fix the spacing of labels on draw_bounding_boxes (#3895)
parent
74559c47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
test/assets/fakedata/draw_boxes_util.png
test/assets/fakedata/draw_boxes_util.png
+0
-0
torchvision/utils.py
torchvision/utils.py
+2
-1
No files found.
test/assets/fakedata/draw_boxes_util.png
View replaced file @
74559c47
View file @
0bb9b914
547 Bytes
|
W:
|
H:
560 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
torchvision/utils.py
View file @
0bb9b914
...
...
@@ -211,7 +211,8 @@ def draw_bounding_boxes(
draw
.
rectangle
(
bbox
,
width
=
width
,
outline
=
color
)
if
labels
is
not
None
:
draw
.
text
((
bbox
[
0
],
bbox
[
1
]),
labels
[
i
],
fill
=
color
,
font
=
txt_font
)
margin
=
width
+
1
draw
.
text
((
bbox
[
0
]
+
margin
,
bbox
[
1
]
+
margin
),
labels
[
i
],
fill
=
color
,
font
=
txt_font
)
return
torch
.
from_numpy
(
np
.
array
(
img_to_draw
)).
permute
(
2
,
0
,
1
).
to
(
dtype
=
torch
.
uint8
)
...
...
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