Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def segment_image(input_image, text_input):
|
|
62 |
|
63 |
for i, mask_dict in enumerate(masks):
|
64 |
mask_data = (mask_dict['segmentation'] * 255).astype(np.uint8)
|
65 |
-
segmented_region = cv2.bitwise_and(
|
66 |
|
67 |
x, y, w, h = map(int, mask_dict['bbox'])
|
68 |
cropped_region = segmented_region[y:y+h, x:x+w]
|
|
|
62 |
|
63 |
for i, mask_dict in enumerate(masks):
|
64 |
mask_data = (mask_dict['segmentation'] * 255).astype(np.uint8)
|
65 |
+
segmented_region = cv2.bitwise_and(image, image, mask=mask_data)
|
66 |
|
67 |
x, y, w, h = map(int, mask_dict['bbox'])
|
68 |
cropped_region = segmented_region[y:y+h, x:x+w]
|