Update utils.py
Browse files
utils.py
CHANGED
@@ -378,13 +378,13 @@ def get_text_to_panel_mapping(text_bboxes, sorted_panel_bboxes):
|
|
378 |
|
379 |
def sort_texts_within_panel(rects):
|
380 |
smallest_y = float("inf")
|
381 |
-
|
382 |
for i, rect in enumerate(rects):
|
383 |
x1, y1, x2, y2 = rect
|
384 |
smallest_y = min(smallest_y, y1)
|
385 |
-
|
386 |
|
387 |
-
reference_point = Point(
|
388 |
|
389 |
polygons_and_index = []
|
390 |
for i, rect in enumerate(rects):
|
|
|
378 |
|
379 |
def sort_texts_within_panel(rects):
|
380 |
smallest_y = float("inf")
|
381 |
+
smallest_x = float("-inf")
|
382 |
for i, rect in enumerate(rects):
|
383 |
x1, y1, x2, y2 = rect
|
384 |
smallest_y = min(smallest_y, y1)
|
385 |
+
smallest_x = max(smallest_x, x1)
|
386 |
|
387 |
+
reference_point = Point(smallest_x, smallest_y)
|
388 |
|
389 |
polygons_and_index = []
|
390 |
for i, rect in enumerate(rects):
|