From 7b51a8f7a6e50173c471e9d3098ea0bf31cb99d5 Mon Sep 17 00:00:00 2001 From: chace20 Date: Fri, 16 Jun 2023 10:59:57 +0800 Subject: [PATCH] fix: sam return float raise exception --- scripts/sa_mask.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/sa_mask.py b/scripts/sa_mask.py index fb9116e..fb2abdd 100644 --- a/scripts/sa_mask.py +++ b/scripts/sa_mask.py @@ -102,6 +102,7 @@ def filter_masks( filtered_masks.append(mask) x, y, w, h = mask["bbox"] + x, y, w, h = int(x), int(y), int(w), int(h) crop = image[y : y + h, x : x + w] crop = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB) crop = PIL.Image.fromarray(np.uint8(crop * 255)).convert("RGB")