Skip to content

Commit d1d4db8

Browse files
committed
chore: rm demo change
1 parent 4f9a955 commit d1d4db8

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

demo_lineless.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
output_dir = Path("outputs")
1414
output_dir.mkdir(parents=True, exist_ok=True)
15-
if __name__ == "__main__":
16-
img_path = "tests/test_files/table.jpg"
17-
table_rec = LinelessTableRecognition()
1815

19-
html, elasp, polygons, logic_points, ocr_res = table_rec(img_path)
20-
print(f"cost: {elasp:.5f}")
16+
img_path = "tests/test_files/lineless_table_recognition.jpg"
17+
table_rec = LinelessTableRecognition()
2118

22-
complete_html = format_html(html)
19+
html, elasp, polygons, logic_points, ocr_res = table_rec(img_path)
20+
print(f"cost: {elasp:.5f}")
2321

24-
save_table_path = output_dir / "table.html"
25-
with open(save_table_path, "w", encoding="utf-8") as file:
26-
file.write(complete_html)
22+
complete_html = format_html(html)
2723

28-
plot_rec_box_with_logic_info(
29-
img_path, f"{output_dir}/table_rec_box.jpg", logic_points, polygons
30-
)
31-
plot_rec_box(img_path, f"{output_dir}/ocr_box.jpg", ocr_res)
32-
print(f"The results has been saved under {output_dir}")
24+
save_table_path = output_dir / "table.html"
25+
with open(save_table_path, "w", encoding="utf-8") as file:
26+
file.write(complete_html)
27+
28+
plot_rec_box_with_logic_info(
29+
img_path, f"{output_dir}/table_rec_box.jpg", logic_points, polygons
30+
)
31+
plot_rec_box(img_path, f"{output_dir}/ocr_box.jpg", ocr_res)
32+
print(f"The results has been saved under {output_dir}")

demo_wired.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@
1515

1616
table_rec = WiredTableRecognition()
1717

18-
img_path = "tests/test_files/wired/table_recognition.jpg"
19-
if __name__ == "__main__":
20-
html, elasp, polygons, logic_points, ocr_res = table_rec(img_path)
18+
img_path = "tests/test_files/wired/table1.png"
19+
html, elasp, polygons, logic_points, ocr_res = table_rec(img_path)
2120

22-
print(f"cost: {elasp:.5f}")
21+
print(f"cost: {elasp:.5f}")
2322

24-
complete_html = format_html(html)
23+
complete_html = format_html(html)
2524

26-
save_table_path = output_dir / "table.html"
27-
with open(save_table_path, "w", encoding="utf-8") as file:
28-
file.write(complete_html)
25+
save_table_path = output_dir / "table.html"
26+
with open(save_table_path, "w", encoding="utf-8") as file:
27+
file.write(complete_html)
2928

30-
plot_rec_box_with_logic_info(
31-
img_path, f"{output_dir}/table_rec_box.jpg", logic_points, polygons
32-
)
33-
plot_rec_box(img_path, f"{output_dir}/ocr_box.jpg", ocr_res)
29+
plot_rec_box_with_logic_info(
30+
img_path, f"{output_dir}/table_rec_box.jpg", logic_points, polygons
31+
)
32+
plot_rec_box(img_path, f"{output_dir}/ocr_box.jpg", ocr_res)
3433

35-
print(f"The results has been saved under {output_dir}")
34+
print(f"The results has been saved under {output_dir}")

0 commit comments

Comments
 (0)