[Fix]: fix docstring of visualization (#417)

This commit is contained in:
RenQin 2022-08-18 20:17:29 +08:00 committed by GitHub
parent 8de714fa76
commit adbcd176b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class SelfSupDataSample(BaseDataElement):
>>> import torch
>>> import numpy as np
>>> from mmengine.data import InstanceData
>>> from mmselfsup.core import SelfSupDataSample
>>> from mmselfsup.structures import SelfSupDataSample
>>> data_sample = SelfSupDataSample()
>>> gt_label = LabelData()

View File

@ -62,7 +62,7 @@ class SelfSupVisualizer(Visualizer):
def __init__(self,
name: str = 'visualizer',
image: Optional[np.ndarray] = None,
vis_backends: Optional[Dict] = None,
vis_backends: Optional[List[Dict]] = None,
save_dir: Optional[str] = None,
line_width: Union[int, float] = 3,
alpha: Union[int, float] = 0.8):
@ -84,12 +84,12 @@ class SelfSupVisualizer(Visualizer):
boxes: InstanceData,
edge_colors: Union[str, tuple, List[str], List[tuple]] = 'r'
) -> np.ndarray:
"""Draw instances of GT or prediction.
"""Draw instance with boxes.
Args:
image (np.ndarray): The image to draw.
boxes (:obj:`InstanceData`): Data structure for
instance-level annotations or predictions.
instance-level box annotations.
edge_colors (Union[str, tuple, List[str], List[tuple]]): The
colors of boxes. ``colors`` can have the same length with
lines or just single value. If ``colors`` is single value, all
@ -115,12 +115,12 @@ class SelfSupVisualizer(Visualizer):
mask: InstanceData,
colors: Union[str, tuple, List[str],
List[tuple]] = 'k') -> np.ndarray:
"""Draw binary mask of GT or prediction.
"""Draw instance with binary mask.
Args:
image (np.ndarray): The image to draw.
mask (:obj:`InstanceData`): Data structure for
pixel-level annotations or predictions.
pixel-level annotations.
colors (Union[str, tuple, List[str], List[tuple]]): The colors
which binary_masks will convert to. ``colors`` can have
the same length with binary_masks or just single value.