Skip to content

Commit

Permalink
[Fix] Fix deprecated np.bool (open-mmlab#685)
Browse files Browse the repository at this point in the history
* [Fix] Fix deprecated np.bool

* lint
  • Loading branch information
nijkah authored Feb 1, 2023
1 parent b2f7ff2 commit e735ca9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mmrotate/core/evaluation/eval_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def tpfp_default(det_bboxes,
# an indicator of ignored gts
det_bboxes = np.array(det_bboxes)
gt_ignore_inds = np.concatenate(
(np.zeros(gt_bboxes.shape[0], dtype=np.bool),
np.ones(gt_bboxes_ignore.shape[0], dtype=np.bool)))
(np.zeros(gt_bboxes.shape[0],
dtype=bool), np.ones(gt_bboxes_ignore.shape[0], dtype=bool)))
# stack gt_bboxes and gt_bboxes_ignore for convenience
gt_bboxes = np.vstack((gt_bboxes, gt_bboxes_ignore))

Expand Down
2 changes: 1 addition & 1 deletion mmrotate/core/patch/merge_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def map_masks(masks, offset, new_shape):
ori_height -= y_end - new_height
y_end = new_height

extended_mask = np.zeros((new_height, new_width), dtype=np.bool)
extended_mask = np.zeros((new_height, new_width), dtype=bool)
extended_mask[y_start:y_end,
x_start:x_end] = mask[:ori_height, :ori_width]
mapped.append(extended_mask)
Expand Down

0 comments on commit e735ca9

Please sign in to comment.