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
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.
Args:
......@@ -17,22 +17,22 @@ def show_img(img, win_name='', wait_time=0):
cv2.waitKey(wait_time)
def draw_bboxes(img,
bboxes,
colors='green',
top_k=-1,
thickness=1,
show=True,
win_name='',
wait_time=0,
out_file=None):
def imshow_bboxes(img,
bboxes,
colors='green',
top_k=-1,
thickness=1,
show=True,
win_name='',
wait_time=0,
out_file=None):
"""Draw bboxes on an image.
Args:
img (str or ndarray): The image to be displayed.
bboxes (list or ndarray): A list of ndarray of shape (k, 4).
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.
show (bool): Whether to show the image.
win_name (str): The window name.
......@@ -61,6 +61,6 @@ def draw_bboxes(img,
img, left_top, right_bottom, colors[i], thickness=thickness)
if show:
show_img(img, win_name, wait_time)
imshow(img, win_name, wait_time)
if out_file is not None:
imwrite(img, out_file)
......@@ -2,12 +2,12 @@ from __future__ import division
import numpy as np
from .image import show_img
from .image import imshow
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.
Args:
......@@ -15,9 +15,9 @@ def show_flow(flow, win_name='', wait_time=0):
win_name (str): The window name.
wait_time (int): Value of waitKey param.
"""
flow = read_flow(flow)
flow = flowread(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):
......
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