Spaces:
Running
Running
tweak
Browse files
app.py
CHANGED
|
@@ -135,13 +135,13 @@ def filter_overlapping_boxes(filter_box_info, iou_threshold=0.5):
|
|
| 135 |
for i, box in enumerate(other_boxes):
|
| 136 |
should_keep = True
|
| 137 |
|
| 138 |
-
for kept_box in
|
| 139 |
if calculate_iou(box, kept_box) > iou_threshold:
|
| 140 |
should_keep = False
|
| 141 |
break
|
| 142 |
if should_keep:
|
| 143 |
-
|
| 144 |
-
return
|
| 145 |
|
| 146 |
def getCenterXDis(box1, box2):
|
| 147 |
x0_1, y0_1, x1_1, y1_1 = box1
|
|
|
|
| 135 |
for i, box in enumerate(other_boxes):
|
| 136 |
should_keep = True
|
| 137 |
|
| 138 |
+
for kept_box in kept_other_boxes:
|
| 139 |
if calculate_iou(box, kept_box) > iou_threshold:
|
| 140 |
should_keep = False
|
| 141 |
break
|
| 142 |
if should_keep:
|
| 143 |
+
kept_other_boxes.append(box)
|
| 144 |
+
return kept_other_boxes + kept_boxes
|
| 145 |
|
| 146 |
def getCenterXDis(box1, box2):
|
| 147 |
x0_1, y0_1, x1_1, y1_1 = box1
|