Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
change the order of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakuyume committed May 27, 2017
1 parent 1356ec7 commit 7575348
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chainercv/visualizations/vis_label.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np


def vis_label(label, alpha=1, label_names=None, ax=None):
def vis_label(label, label_names=None, alpha=1, ax=None):
"""Visualize label of semantic segmentation.
Example:
Expand All @@ -15,22 +15,23 @@ def vis_label(label, alpha=1, label_names=None, ax=None):
>>> dataset = VOCSemanticSegmentationDataset()
>>> img, label = dataset[60]
>>> ax = vis_image(img)
>>> vis_label(label, alpha=0.75,
... label_names=voc_semantic_segmentation_label_names, ax=ax)
>>> vis_label(
... label, label_names=voc_semantic_segmentation_label_names,
... alpha=0.75, ax=ax)
>>> plot.show()
Args:
label (~numpy.ndarray): An integer array of shape
:math:`(height, width)`.
The values correspond to id for label names stored in
:obj:`label_names`.
label_names (iterable of strings): Name of labels ordered according
to label ids. If this is :obj:`None`, labels will be skipped.
alpha (float): The value which determines transparency of the figure.
The range of this value is :math:`[0, 1]`. If this
value is :obj:`0`, the figure will be completely transparent.
The default value is :obj:`1`. This option is useful for
overlaying labels on the source images.
label_names (iterable of strings): Name of labels ordered according
to label ids. If this is :obj:`None`, labels will be skipped.
ax (matplotlib.axes.Axis): The visualization is displayed on this
axis. If this is :obj:`None` (default), a new axis is created.
Expand Down

0 comments on commit 7575348

Please sign in to comment.