-
Notifications
You must be signed in to change notification settings - Fork 303
Support using vis_bbox together with vis_instance_segmentation #560
Support using vis_bbox together with vis_instance_segmentation #560
Conversation
yuyu2172
commented
Apr 9, 2018
•
edited
Loading
edited
chainercv/visualizations/colormap.py
Outdated
"""Color map used in PASCAL VOC | ||
|
||
Args: | ||
label (int): Class id. | ||
labels (~numpy.ndarray): Class ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list of int?
chainercv/visualizations/colormap.py
Outdated
@@ -5,7 +5,7 @@ def voc_colormap(labels): | |||
"""Color map used in PASCAL VOC | |||
|
|||
Args: | |||
labels (~numpy.ndarray): Class ids. | |||
labels (list of ints): Class ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about iterable of ints
?
Can we support specifying color for each class in |
chainercv/visualizations/vis_bbox.py
Outdated
"""Visualize bounding boxes inside image. | ||
|
||
Example: | ||
|
||
>>> from chainercv.datasets import VOCDetectionDataset | ||
>>> from chainercv.datasets import VOCBboxDataset | ||
>>> from chainercv.datasets import voc_bbox_label_names | ||
>>> from chainercv.visualizations import vis_bbox | ||
>>> import matplotlib.pyplot as plot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plot
-> plt
(chainer/chainer#3698)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has not been fixed yet in ChainerCV.
chainercv/visualizations/vis_bbox.py
Outdated
@@ -32,6 +51,15 @@ def vis_bbox(img, bbox, label=None, score=None, label_names=None, ax=None): | |||
This is optional. | |||
label_names (iterable of strings): Name of labels ordered according | |||
to label ids. If this is :obj:`None`, labels will be skipped. | |||
instance_colors (iterable of tuple): List of colors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuple
-> tuples
chainercv/visualizations/vis_bbox.py
Outdated
@@ -54,12 +82,20 @@ def vis_bbox(img, bbox, label=None, score=None, label_names=None, ax=None): | |||
if len(bbox) == 0: | |||
return ax | |||
|
|||
if instance_colors is None: | |||
# Red | |||
instance_colors = np.ones((len(bbox), 3), dtype=np.float32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ones
-> zeros
?