Skip to content
Snippets Groups Projects
Unverified Commit ea4ffff8 authored by Cao Yuhang's avatar Cao Yuhang Committed by GitHub
Browse files

Fix mask show (#2763)

* fix ms rcnn show

* fix show error when empty det
parent b20d6993
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,8 @@ class BaseDetector(nn.Module, metaclass=ABCMeta):
img = img.copy()
if isinstance(result, tuple):
bbox_result, segm_result = result
if isinstance(segm_result, tuple):
segm_result = segm_result[0] # ms rcnn
else:
bbox_result, segm_result = result, None
bboxes = np.vstack(bbox_result)
......@@ -197,7 +199,7 @@ class BaseDetector(nn.Module, metaclass=ABCMeta):
]
labels = np.concatenate(labels)
# draw segmentation masks
if segm_result is not None:
if segm_result is not None and len(labels) > 0: # non empty
segms = mmcv.concat_list(segm_result)
inds = np.where(bboxes[:, -1] > score_thr)[0]
np.random.seed(42)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment