Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 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()
|