Spaces:
Runtime error
Runtime error
wsfung2008
commited on
Commit
•
cd4dcaf
1
Parent(s):
80298ee
Update app.py
Browse files
app.py
CHANGED
@@ -20,15 +20,16 @@ def find_layout(image):
|
|
20 |
result = table_engine(img)
|
21 |
save_structure_res(result, save_folder, os.path.basename("result").split('.')[0])
|
22 |
|
|
|
|
|
|
|
23 |
final_text = []
|
24 |
for line in result:
|
25 |
line.pop('img')
|
26 |
print(line)
|
27 |
final_text.append(line)
|
28 |
|
29 |
-
|
30 |
-
res = sorted_layout_boxes(result, w)
|
31 |
-
convert_info_docx(img, res, save_folder, os.path.basename("result").split('.')[0])
|
32 |
|
33 |
return final_text
|
34 |
|
|
|
20 |
result = table_engine(img)
|
21 |
save_structure_res(result, save_folder, os.path.basename("result").split('.')[0])
|
22 |
|
23 |
+
h, w, _ = img.shape
|
24 |
+
res = sorted_layout_boxes(result, w)
|
25 |
+
|
26 |
final_text = []
|
27 |
for line in result:
|
28 |
line.pop('img')
|
29 |
print(line)
|
30 |
final_text.append(line)
|
31 |
|
32 |
+
# convert_info_docx(img, res, save_folder, os.path.basename("result").split('.')[0])
|
|
|
|
|
33 |
|
34 |
return final_text
|
35 |
|