Merge pull request #44 from chace20/main

Fix: slice indices must be integers or None or have an __index__ method
pull/48/head
mattya_monaca 2023-06-17 09:44:16 +09:00 committed by GitHub
commit 30f308cd70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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")