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
2f49db9d
Commit
2f49db9d
authored
Aug 28, 2018
by
Kai Chen
Browse files
method renames
parent
978ecfda
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
mmcv/visualization/image.py
mmcv/visualization/image.py
+12
-12
mmcv/visualization/optflow.py
mmcv/visualization/optflow.py
+5
-5
No files found.
mmcv/visualization/image.py
View file @
2f49db9d
...
@@ -5,7 +5,7 @@ from mmcv.image import imread, imwrite
...
@@ -5,7 +5,7 @@ from mmcv.image import imread, imwrite
from
.color
import
color_val
from
.color
import
color_val
def
show
_img
(
img
,
win_name
=
''
,
wait_time
=
0
):
def
im
show
(
img
,
win_name
=
''
,
wait_time
=
0
):
"""Show an image.
"""Show an image.
Args:
Args:
...
@@ -17,7 +17,7 @@ def show_img(img, win_name='', wait_time=0):
...
@@ -17,7 +17,7 @@ def show_img(img, win_name='', wait_time=0):
cv2
.
waitKey
(
wait_time
)
cv2
.
waitKey
(
wait_time
)
def
dra
w_bboxes
(
img
,
def
imsho
w_bboxes
(
img
,
bboxes
,
bboxes
,
colors
=
'green'
,
colors
=
'green'
,
top_k
=-
1
,
top_k
=-
1
,
...
@@ -32,7 +32,7 @@ def draw_bboxes(img,
...
@@ -32,7 +32,7 @@ def draw_bboxes(img,
img (str or ndarray): The image to be displayed.
img (str or ndarray): The image to be displayed.
bboxes (list or ndarray): A list of ndarray of shape (k, 4).
bboxes (list or ndarray): A list of ndarray of shape (k, 4).
colors (list[str or tuple or Color]): A list of colors.
colors (list[str or tuple or Color]): A list of colors.
top_k (int):
Draw
the first k bboxes only if set positive.
top_k (int):
Plot
the first k bboxes only if set positive.
thickness (int): Thickness of lines.
thickness (int): Thickness of lines.
show (bool): Whether to show the image.
show (bool): Whether to show the image.
win_name (str): The window name.
win_name (str): The window name.
...
@@ -61,6 +61,6 @@ def draw_bboxes(img,
...
@@ -61,6 +61,6 @@ def draw_bboxes(img,
img
,
left_top
,
right_bottom
,
colors
[
i
],
thickness
=
thickness
)
img
,
left_top
,
right_bottom
,
colors
[
i
],
thickness
=
thickness
)
if
show
:
if
show
:
show
_img
(
img
,
win_name
,
wait_time
)
im
show
(
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
)
mmcv/visualization/optflow.py
View file @
2f49db9d
...
@@ -2,12 +2,12 @@ from __future__ import division
...
@@ -2,12 +2,12 @@ from __future__ import division
import
numpy
as
np
import
numpy
as
np
from
.image
import
show
_img
from
.image
import
im
show
from
mmcv.image
import
rgb2bgr
from
mmcv.image
import
rgb2bgr
from
mmcv.video
import
read_
flow
from
mmcv.video
import
flow
read
def
show_fl
ow
(
flow
,
win_name
=
''
,
wait_time
=
0
):
def
flowsh
ow
(
flow
,
win_name
=
''
,
wait_time
=
0
):
"""Show optical flow.
"""Show optical flow.
Args:
Args:
...
@@ -15,9 +15,9 @@ def show_flow(flow, win_name='', wait_time=0):
...
@@ -15,9 +15,9 @@ def show_flow(flow, win_name='', wait_time=0):
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.
"""
"""
flow
=
read_
flow
(
flow
)
flow
=
flow
read
(
flow
)
flow_img
=
flow2rgb
(
flow
)
flow_img
=
flow2rgb
(
flow
)
show
_img
(
rgb2bgr
(
flow_img
),
win_name
,
wait_time
)
im
show
(
rgb2bgr
(
flow_img
),
win_name
,
wait_time
)
def
flow2rgb
(
flow
,
color_wheel
=
None
,
unknown_thr
=
1e6
):
def
flow2rgb
(
flow
,
color_wheel
=
None
,
unknown_thr
=
1e6
):
...
...
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