Update xfund.py
Browse files
xfund.py
CHANGED
|
@@ -9,11 +9,9 @@ def load_image(image_path):
|
|
| 9 |
return image, (w, h)
|
| 10 |
|
| 11 |
def normalize_bbox(bbox, size):
|
| 12 |
-
|
| 13 |
-
width = size.get("width", 1) # Default to 1 to avoid division by zero
|
| 14 |
height = size.get("height", 1)
|
| 15 |
|
| 16 |
-
# Normalize the bounding box coordinates
|
| 17 |
return [
|
| 18 |
int(1000 * bbox[0] / width), # x_min
|
| 19 |
int(1000 * bbox[1] / height), # y_min
|
|
|
|
| 9 |
return image, (w, h)
|
| 10 |
|
| 11 |
def normalize_bbox(bbox, size):
|
| 12 |
+
width = size.get("width", 1)
|
|
|
|
| 13 |
height = size.get("height", 1)
|
| 14 |
|
|
|
|
| 15 |
return [
|
| 16 |
int(1000 * bbox[0] / width), # x_min
|
| 17 |
int(1000 * bbox[1] / height), # y_min
|