onursavas commited on
Commit
d79cab6
·
1 Parent(s): 6afb5fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -15,15 +15,16 @@ def find_layout(name):
15
  result = table_engine(img)
16
  save_structure_res(result, save_folder, os.path.basename(img_path).split('.')[0])
17
 
 
18
  for line in result:
19
  line.pop('img')
20
  print(line)
21
-
22
  h, w, _ = img.shape
23
  res = sorted_layout_boxes(result, w)
24
  convert_info_docx(img, res, save_folder, os.path.basename(img_path).split('.')[0])
25
 
26
- return "Done processing 0.png"
27
 
28
  iface = gr.Interface(fn=find_layout, inputs="text", outputs="text")
29
  iface.launch()
 
15
  result = table_engine(img)
16
  save_structure_res(result, save_folder, os.path.basename(img_path).split('.')[0])
17
 
18
+ final_text = ""
19
  for line in result:
20
  line.pop('img')
21
  print(line)
22
+ final_text += "\n" + line
23
  h, w, _ = img.shape
24
  res = sorted_layout_boxes(result, w)
25
  convert_info_docx(img, res, save_folder, os.path.basename(img_path).split('.')[0])
26
 
27
+ return final_text
28
 
29
  iface = gr.Interface(fn=find_layout, inputs="text", outputs="text")
30
  iface.launch()