moritzbur commited on
Commit
94a87af
·
verified ·
1 Parent(s): e5c700b

Update xfund.py

Browse files
Files changed (1) hide show
  1. xfund.py +1 -3
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
- # Ensure we access 'width' and 'height' keys from the size dictionary
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