Commit 2f49db9d authored by Kai Chen's avatar Kai Chen
Browse files

method renames

parent 978ecfda
...@@ -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 imshow(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 draw_bboxes(img, def imshow_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) 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)
...@@ -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 imshow
from mmcv.image import rgb2bgr from mmcv.image import rgb2bgr
from mmcv.video import read_flow from mmcv.video import flowread
def show_flow(flow, win_name='', wait_time=0): def flowshow(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 = flowread(flow)
flow_img = flow2rgb(flow) flow_img = flow2rgb(flow)
show_img(rgb2bgr(flow_img), win_name, wait_time) imshow(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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment