From 8b3360eb75dae2f35a7f5b6c71570c5e1d8b942d Mon Sep 17 00:00:00 2001 From: damaggu Date: Sun, 4 Aug 2024 21:08:57 -0700 Subject: [PATCH] fix interpolation --- SwissKnife/mrcnn/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SwissKnife/mrcnn/utils.py b/SwissKnife/mrcnn/utils.py index 69963e7..4f83aba 100644 --- a/SwissKnife/mrcnn/utils.py +++ b/SwissKnife/mrcnn/utils.py @@ -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: