NicFromLM commited on
Commit
03a584c
·
verified ·
1 Parent(s): 9a1d4c7

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
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
- greatest_x = float("-inf")
382
  for i, rect in enumerate(rects):
383
  x1, y1, x2, y2 = rect
384
  smallest_y = min(smallest_y, y1)
385
- greatest_x = max(greatest_x, x2)
386
 
387
- reference_point = Point(greatest_x, smallest_y)
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):