Skip to content

Commit

Permalink
Merge pull request #8 from ChaseMonsterAway/master
Browse files Browse the repository at this point in the history
fix: show ignore image problem when only gt file.
  • Loading branch information
hxcai authored Dec 8, 2020
2 parents a3962ba + f5d785e commit a189a27
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions volkscv/analyzer/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ def draw_bbox(img,
bboxes = anno.get('bboxes')
labels = anno.get('labels')
scores = anno.get('scores')
not_ignore = bboxes.shape[0]
labels_ignore = anno.get('labels_ignore', np.zeros((0,)))
bboxes_ignore = anno.get('bboxes_ignore', np.zeros((0, 4)))

Expand Down Expand Up @@ -508,6 +509,12 @@ def draw_bbox(img,
if not show_fpfn:
cv2.rectangle(img_, left_top, right_bottom,
color=color, thickness=base_thickness)
if show_ignore and idx >= not_ignore:
thickness = base_thickness
color = color_ignore
cv2.rectangle(
img_, left_top, right_bottom, color=color,
thickness=thickness)
else:
if len(f) and f[idx]:
if show_fpfn_format == 'mask':
Expand Down

0 comments on commit a189a27

Please sign in to comment.