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

Change doc style of vis_* #803

Merged
merged 1 commit into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
change doc style
  • Loading branch information
yuyu2172 committed Feb 20, 2019
commit 926d8d72cdee1787f10c1ae01470683b365b6a26
29 changes: 16 additions & 13 deletions chainercv/visualizations/vis_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ def vis_bbox(img, bbox, label=None, score=None, label_names=None,
>>> plt.show()

Args:
img (~numpy.ndarray): An array of shape :math:`(3, height, width)`.
This is in RGB format and the range of its value is
:math:`[0, 255]`. If this is :obj:`None`, no image is displayed.
bbox (~numpy.ndarray): An array of shape :math:`(R, 4)`, where
:math:`R` is the number of bounding boxes in the image.
Each element is organized
by :math:`(y_{min}, x_{min}, y_{max}, x_{max})` in the second axis.
label (~numpy.ndarray): An integer array of shape :math:`(R,)`.
The values correspond to id for label names stored in
:obj:`label_names`. This is optional.
score (~numpy.ndarray): A float array of shape :math:`(R,)`.
Each value indicates how confident the prediction is.
This is optional.
img (~numpy.ndarray): See the table below. If this is :obj:`None`,
no image is displayed.
bbox (~numpy.ndarray): See the table below.
label (~numpy.ndarray): See the table below. This is optional.
score (~numpy.ndarray): See the table below. 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 tuples): List of colors.
Expand All @@ -66,6 +58,17 @@ def vis_bbox(img, bbox, label=None, score=None, label_names=None,
ax (matplotlib.axes.Axis): The visualization is displayed on this
axis. If this is :obj:`None` (default), a new axis is created.

.. csv-table::
:header: name, shape, dtype, format

:obj:`img`, ":math:`(3, H, W)`", :obj:`float32`, \
"RGB, :math:`[0, 255]`"
:obj:`bbox`, ":math:`(R, 4)`", :obj:`float32`, \
":math:`(y_{min}, x_{min}, y_{max}, x_{max})`"
:obj:`label`, ":math:`(R,)`", :obj:`int32`, \
":math:`[0, \#fg\_class - 1]`"
:obj:`score`, ":math:`(R,)`", :obj:`float32`, --

Returns:
~matploblib.axes.Axes:
Returns the Axes object with the plot for further tweaking.
Expand Down
11 changes: 8 additions & 3 deletions chainercv/visualizations/vis_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ def vis_image(img, ax=None):
"""Visualize a color image.

Args:
img (~numpy.ndarray): An array of shape :math:`(3, height, width)`.
This is in RGB format and the range of its value is
:math:`[0, 255]`. If this is :obj:`None`, no image is displayed.
img (~numpy.ndarray): See the table below.
If this is :obj:`None`, no image is displayed.
ax (matplotlib.axes.Axis): The visualization is displayed on this
axis. If this is :obj:`None` (default), a new axis is created.

.. csv-table::
:header: name, shape, dtype, format

:obj:`img`, ":math:`(3, H, W)`", :obj:`float32`, \
"RGB, :math:`[0, 255]`"

Returns:
~matploblib.axes.Axes:
Returns the Axes object with the plot for further tweaking.
Expand Down
28 changes: 15 additions & 13 deletions chainercv/visualizations/vis_instance_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,11 @@ def vis_instance_segmentation(
>>> plt.show()

Args:
img (~numpy.ndarray): An array of shape :math:`(3, H, W)`.
This is in RGB format and the range of its value is
:math:`[0, 255]`. If this is :obj:`None`, no image is displayed.
mask (~numpy.ndarray): A bool array of shape
:math`(R, H, W)`.
If there is an object, the value of the pixel is :obj:`True`,
and otherwise, it is :obj:`False`.
label (~numpy.ndarray): An integer array of shape :math:`(R, )`.
The values correspond to id for label names stored in
:obj:`label_names`.
score (~numpy.ndarray): A float array of shape :math:`(R,)`.
Each value indicates how confident the prediction is.
This is optional.
img (~numpy.ndarray): See the table below. If this is :obj:`None`,
no image is displayed.
mask (~numpy.ndarray): See the table below.
label (~numpy.ndarray): See the table below. This is optional.
score (~numpy.ndarray): See the table below. This is optional.
label_names (iterable of strings): Name of labels ordered according
to label ids.
instance_colors (iterable of tuple): List of colors.
Expand All @@ -82,6 +74,16 @@ def vis_instance_segmentation(
ax (matplotlib.axes.Axis): The visualization is displayed on this
axis. If this is :obj:`None` (default), a new axis is created.

.. csv-table::
:header: name, shape, dtype, format

:obj:`img`, ":math:`(3, H, W)`", :obj:`float32`, \
"RGB, :math:`[0, 255]`"
:obj:`mask`, ":math:`(R, H, W)`", :obj:`bool`, --
:obj:`label`, ":math:`(R,)`", :obj:`int32`, \
":math:`[0, \#fg\_class - 1]`"
:obj:`score`, ":math:`(R,)`", :obj:`float32`, --

Returns:
matploblib.axes.Axes: Returns :obj:`ax`.
:obj:`ax` is an :class:`matploblib.axes.Axes` with the plot.
Expand Down
18 changes: 11 additions & 7 deletions chainercv/visualizations/vis_semantic_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ def vis_semantic_segmentation(
>>> plt.show()

Args:
img (~numpy.ndarray): An array of shape :math:`(3, height, width)`.
This is in RGB format and the range of its value is
:math:`[0, 255]`. If this is :obj:`None`, no image is displayed.
label (~numpy.ndarray): An integer array of shape
:math:`(height, width)`.
The values correspond to id for label names stored in
:obj:`label_names`.
img (~numpy.ndarray): See the table below. If this is :obj:`None`,
no image is displayed.
label (~numpy.ndarray): See the table below.
label_names (iterable of strings): Name of labels ordered according
to label ids.
label_colors: (iterable of tuple): An iterable of colors for regular
Expand All @@ -63,6 +59,14 @@ def vis_semantic_segmentation(
ax (matplotlib.axes.Axis): The visualization is displayed on this
axis. If this is :obj:`None` (default), a new axis is created.

.. csv-table::
:header: name, shape, dtype, format

:obj:`img`, ":math:`(3, H, W)`", :obj:`float32`, \
"RGB, :math:`[0, 255]`"
:obj:`label`, ":math:`(H, W)`", :obj:`int32`, \
":math:`[-1, \#class - 1]`"

Returns:
matploblib.axes.Axes and list of matplotlib.patches.Patch:
Returns :obj:`ax` and :obj:`legend_handles`.
Expand Down