-
Notifications
You must be signed in to change notification settings - Fork 302
Add vis instance segmentation func #541
Add vis instance segmentation func #541
Conversation
8019556
to
59604e2
Compare
59604e2
to
7b14cfa
Compare
2003d55
to
10d8d69
Compare
if score is not None and not len(bbox) == len(score): | ||
raise ValueError('The length of score must be same as that of bbox') | ||
|
||
n_ins_class = len(bbox) |
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.
s/n_ins_class/n_inst
n_ins_class
sounds like this is related to class categories.
raise ValueError('The length of score must be same as that of bbox') | ||
|
||
n_ins_class = len(bbox) | ||
colors = [_default_cmap(l) for l in range(n_ins_class + 1)] |
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 range(1, n_inst)
?
By doing so, you can remove one line.
Also, np.array
is optional in this case, so we can omit it.
if label is not None and not len(bbox) == len(label): | ||
raise ValueError('The length of label must be same as that of bbox') | ||
if score is not None and not len(bbox) == len(score): | ||
raise ValueError('The length of score must be same as that of bbox') |
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 checking mask
as well?
# Returns newly instantiated matplotlib.axes.Axes object if ax is None | ||
ax = vis_image(img, ax=ax) | ||
|
||
vis_img = np.zeros((mask.shape[1], mask.shape[2], 4), dtype=np.uint8) |
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.
vis_img
has very similar name to vis_image
.
How about canvas
?
This is in RGB format and the range of its value is | ||
:math:`[0, 255]`. | ||
bbox (~numpy.ndarray): A float array of shape :math:`(R, 4)`. | ||
R is the number of objects in the image, and each vector |
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.
R --> `:math:`R``
>>> from chainercv.datasets import SBDInstanceSegmentationDataset | ||
>>> from chainercv.datasets \ | ||
... import sbd_instance_segmentation_label_names | ||
>>> from chainercv.visualizations import vis_image |
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.
We do not need vis_image
10d8d69
to
0b934de
Compare
Please rebase master |
705e2fd
to
f53bc22
Compare
i rebased and updated |
:obj:`label_names`. | ||
label_names (iterable of strings): Name of labels ordered according | ||
to label ids. | ||
alpha (float): The value which determines transparency of the figure. |
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.
Is alpha=1
a reasonable default value?
To me, alpha=0.7
looks better.
Also, the doc needs to be changed if we are changing this.
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.
I prefer alpha=0.7, so I will change it
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.
I updated.
f53bc22
to
d163005
Compare
Merge after #540
vis_instance_segmentation
test_vis_instance_segmentation_dataset.py