Spaces:
Running
Running
- modules/toXML.py +3 -2
modules/toXML.py
CHANGED
@@ -168,8 +168,9 @@ def create_XML(full_pred, text_mapping, size_scale, scale):
|
|
168 |
|
169 |
# Calculate the bounding box for the pool
|
170 |
#if len(keep_elements) == 0:
|
171 |
-
|
172 |
-
|
|
|
173 |
min_x, min_y, max_x, max_y = full_pred['boxes'][pool_index]
|
174 |
pool_width = max_x - min_x
|
175 |
pool_height = max_y - min_y
|
|
|
168 |
|
169 |
# Calculate the bounding box for the pool
|
170 |
#if len(keep_elements) == 0:
|
171 |
+
if pool_index >= len(full_pred['boxes']):
|
172 |
+
print("Problem with the index")
|
173 |
+
continue
|
174 |
min_x, min_y, max_x, max_y = full_pred['boxes'][pool_index]
|
175 |
pool_width = max_x - min_x
|
176 |
pool_height = max_y - min_y
|