JaMe76 commited on
Commit
acac30c
·
1 Parent(s): 5769c8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -209,7 +209,7 @@ def analyze_image(img, pdf, max_datapoints):
209
  out = dp.as_dict()
210
  jsonl_out.append(out)
211
  out.pop("_image")
212
- layout_items = dp.layouts
213
  layout_items.sort(key=lambda x: x.reading_order)
214
  layout_items_str += f"\n\n -------- PAGE NUMBER: {dp.page_number+1} ------------- \n"
215
  for item in layout_items:
 
209
  out = dp.as_dict()
210
  jsonl_out.append(out)
211
  out.pop("_image")
212
+ layout_items = [layout for layout in dp.layouts if layout.reading_order is not None]
213
  layout_items.sort(key=lambda x: x.reading_order)
214
  layout_items_str += f"\n\n -------- PAGE NUMBER: {dp.page_number+1} ------------- \n"
215
  for item in layout_items: