NicFromLM commited on
Commit
0ba81e0
·
verified ·
1 Parent(s): 05357ac

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -2
utils.py CHANGED
@@ -377,12 +377,12 @@ def get_text_to_panel_mapping(text_bboxes, sorted_panel_bboxes):
377
  return text_to_panel_mapping
378
 
379
  def sort_texts_within_panel(rects):
380
- smallest_x = float("inf")
381
  smallest_y = float("inf")
 
382
  for i, rect in enumerate(rects):
383
  x1, y1, x2, y2 = rect
384
- smallest_x = min(smallest_x, x1)
385
  smallest_y = min(smallest_y, y1)
 
386
 
387
  reference_point = Point(greatest_x, smallest_y)
388
 
 
377
  return text_to_panel_mapping
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