Skip to content

Commit

Permalink
fix interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
damaggu committed Aug 5, 2024
1 parent db78ca0 commit 8b3360e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SwissKnife/mrcnn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ def minimize_mask(bbox, mask, mini_shape):
See inspect_data.ipynb notebook for more details.
"""
mini_mask = np.zeros(mini_shape + (mask.shape[-1],), dtype=bool)
mini_mask = np.zeros((mini_shape[0], mini_shape[1], mask.shape[-1]), dtype=np.uint8)
for i in range(mask.shape[-1]):
# Pick slice and cast to bool in case load_mask() returned wrong dtype
m = mask[:, :, i].astype(bool)
m = mask[:, :, i]
y1, x1, y2, x2 = bbox[i][:4]
m = m[y1:y2, x1:x2]
if m.size == 0:
Expand Down

0 comments on commit 8b3360e

Please sign in to comment.