fix: sam return float raise exception

pull/44/head
chace20 2023-06-16 10:59:57 +08:00
parent 23a44a256c
commit 7b51a8f7a6
1 changed files with 1 additions and 0 deletions

View File

@ -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")