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
MMCV
Commits
15b37b0b
Unverified
Commit
15b37b0b
authored
Sep 02, 2020
by
Wang Xinjiang
Committed by
GitHub
Sep 02, 2020
Browse files
Allow imshow_det_bboxes to return image with bboxes. (#527)
parent
fc4993cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
mmcv/visualization/image.py
mmcv/visualization/image.py
+8
-0
No files found.
mmcv/visualization/image.py
View file @
15b37b0b
...
@@ -48,6 +48,9 @@ def imshow_bboxes(img,
...
@@ -48,6 +48,9 @@ def imshow_bboxes(img,
win_name (str): The window name.
win_name (str): The window name.
wait_time (int): Value of waitKey param.
wait_time (int): Value of waitKey param.
out_file (str, optional): The filename to write the image.
out_file (str, optional): The filename to write the image.
Returns:
ndarray: The image with bboxes drawn on it.
"""
"""
img
=
imread
(
img
)
img
=
imread
(
img
)
...
@@ -74,6 +77,7 @@ def imshow_bboxes(img,
...
@@ -74,6 +77,7 @@ def imshow_bboxes(img,
imshow
(
img
,
win_name
,
wait_time
)
imshow
(
img
,
win_name
,
wait_time
)
if
out_file
is
not
None
:
if
out_file
is
not
None
:
imwrite
(
img
,
out_file
)
imwrite
(
img
,
out_file
)
return
img
def
imshow_det_bboxes
(
img
,
def
imshow_det_bboxes
(
img
,
...
@@ -106,6 +110,9 @@ def imshow_det_bboxes(img,
...
@@ -106,6 +110,9 @@ def imshow_det_bboxes(img,
win_name (str): The window name.
win_name (str): The window name.
wait_time (int): Value of waitKey param.
wait_time (int): Value of waitKey param.
out_file (str or None): The filename to write the image.
out_file (str or None): The filename to write the image.
Returns:
ndarray: The image with bboxes drawn on it.
"""
"""
assert
bboxes
.
ndim
==
2
assert
bboxes
.
ndim
==
2
assert
labels
.
ndim
==
1
assert
labels
.
ndim
==
1
...
@@ -140,3 +147,4 @@ def imshow_det_bboxes(img,
...
@@ -140,3 +147,4 @@ def imshow_det_bboxes(img,
imshow
(
img
,
win_name
,
wait_time
)
imshow
(
img
,
win_name
,
wait_time
)
if
out_file
is
not
None
:
if
out_file
is
not
None
:
imwrite
(
img
,
out_file
)
imwrite
(
img
,
out_file
)
return
img
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