Spaces:
Runtime error
Runtime error
bthndmn12
commited on
Commit
•
fba9efa
1
Parent(s):
756b28b
fixed some bugs
Browse files
app.py
CHANGED
@@ -15,6 +15,10 @@ model = SamModel.from_pretrained("./checkpoint",local_files_only=True)
|
|
15 |
|
16 |
def get_bbox(gt_map):
|
17 |
|
|
|
|
|
|
|
|
|
18 |
if np.sum(gt_map) == 0:
|
19 |
return [0, 0, gt_map.shape[1], gt_map.shape[0]]
|
20 |
|
|
|
15 |
|
16 |
def get_bbox(gt_map):
|
17 |
|
18 |
+
if gt_map.ndim > 2:
|
19 |
+
gt_map = gt_map[:, :, 0] # Assuming the mask is the same across all channels
|
20 |
+
|
21 |
+
# Check if the ground truth map is empty
|
22 |
if np.sum(gt_map) == 0:
|
23 |
return [0, 0, gt_map.shape[1], gt_map.shape[0]]
|
24 |
|