Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,7 +133,17 @@ def filter_overlapping_boxes(filter_box_info, iou_threshold=0.5):
|
|
| 133 |
kept_boxes.append(box)
|
| 134 |
|
| 135 |
return other_boxes + kept_boxes
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
def to_ordinal(n):
|
| 138 |
"""
|
| 139 |
Converts an integer to its ordinal string representation.
|
|
|
|
| 133 |
kept_boxes.append(box)
|
| 134 |
|
| 135 |
return other_boxes + kept_boxes
|
| 136 |
+
|
| 137 |
+
def getCenterXDis(box1, box2):
|
| 138 |
+
x0_1, y0_1, x1_1, y1_1 = box1
|
| 139 |
+
x0_2, y0_2, x1_2, y1_2 = box2
|
| 140 |
+
#centeral corrdinates
|
| 141 |
+
center_x1 = (x0_1 + x1_1) / 2
|
| 142 |
+
center_y1 = (y0_1 + y1_1) / 2
|
| 143 |
+
center_x2 = (x0_2 + x1_2) / 2
|
| 144 |
+
center_y2 = (y0_2 + y1_2) / 2
|
| 145 |
+
return abs(center_x1 - center_x2)
|
| 146 |
+
|
| 147 |
def to_ordinal(n):
|
| 148 |
"""
|
| 149 |
Converts an integer to its ordinal string representation.
|