mirror of https://github.com/open-mmlab/mmocr.git
[Bug] Bug generated during kie inference visualization (#1830)
* Update kie_visualizer.py * Update kie_visualizer.py * Update kie_visualizer.pypull/1840/head
parent
4842599191
commit
e6174b29fe
mmocr/visualization
|
@ -70,6 +70,8 @@ class KIELocalVisualizer(BaseLocalVisualizer):
|
|||
np.ndarray: The image with edge labels drawn.
|
||||
"""
|
||||
pairs = np.where(edge_labels > 0)
|
||||
if torch.is_tensor(pairs):
|
||||
pairs = pairs.cpu()
|
||||
key_bboxes = bboxes[pairs[0]]
|
||||
value_bboxes = bboxes[pairs[1]]
|
||||
x_data = np.stack([(key_bboxes[:, 2] + key_bboxes[:, 0]) / 2,
|
||||
|
|
Loading…
Reference in New Issue