-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feture] kie visualizer #1267
[Feture] kie visualizer #1267
Conversation
78475f6
to
b14c408
Compare
b14c408
to
faa137b
Compare
10f9a64
to
e46c95b
Compare
if colors is not None and isinstance(colors, Sequence): | ||
size = math.ceil(len(labels) / len(colors)) | ||
colors = (colors * size)[:len(labels)] |
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.
Inconsistent with docstr. Docstr suggesting:
The colors of labels.
``colors`` can be a list of values or just a single
value. If ``colors`` is a single value, all the labels will have
the same color. Otherwise, colors will be assigned to
labels through round robin. Refer to `matplotlib.colors` for the
full list of formats that are accepted. Defaults to 'k'.
Besides, colors
doesn't take effect in this method.
to 10. | ||
auto_font_size (bool): Whether to automatically adjust font size. | ||
Defaults to False. | ||
""" |
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.
Returns:
colors: Union[str, Sequence[str]] = 'g', | ||
filling: bool = False, | ||
line_width: Union[int, float] = 0.5, | ||
alpha: float = 0.5) -> np.ndarray: |
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.
docstr
self.is_openset = is_openset | ||
|
||
@staticmethod | ||
def _draw_labels(visualizer: Visualizer, |
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.
Delete, if inherited from BaseLocalVisualizer
pred_img_data = None | ||
|
||
if draw_gt: | ||
gt_bboxes = data_sample.gt_instances.bboxes |
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.
gt_bboxes = data_sample.gt_instances.bboxes | |
gt_bboxes = data_sample.gt_instances.get('bboxes', None) |
Do the change you have taken my previous suggestions in _draw_instances
, same for line 353
x_datas: Union[np.ndarray, torch.Tensor], | ||
y_datas: Union[np.ndarray, torch.Tensor], |
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.
x_datas: Union[np.ndarray, torch.Tensor], | |
y_datas: Union[np.ndarray, torch.Tensor], | |
x_data: Union[np.ndarray, torch.Tensor], | |
y_data: Union[np.ndarray, torch.Tensor], |
arrow_shapes (str or list[str]]): The shapes of arrow heads. | ||
``arrow_shapes`` can have the same length with lines or just | ||
single value. If ``arrow_shapes`` is single value, all the | ||
lines will have the same shape. Defaults to 'full'. |
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.
Options?
if len(x_datas.shape) == 1: | ||
x_datas = x_datas[None] | ||
y_datas = y_datas[None] | ||
number_arrow = x_datas.shape[0] |
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.
number_arrow = x_datas.shape[0] | |
num_arrows = x_datas.shape[0] |
edge_labels (np.ndarray, torch.Tensor): The edge labels to draw. | ||
The shape of edge_labels should be (N, N), where N is the | ||
number of texts. | ||
texts (Sequence[str]): The texts to draw. The length of texts | ||
should be the same as the number of bboxes. | ||
class_names (dict): The class names for bbox labels. | ||
is_openset (bool): Whether the dataset is openset. Default: False. |
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.
del, also don't forget to sync the docstring after updating the counterpart in KIEVisualizer
e46c95b
to
d646899
Compare
No description provided.