-
Notifications
You must be signed in to change notification settings - Fork 994
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
quyuan
committed
Sep 12, 2024
1 parent
20212a3
commit 8df8737
Showing
13 changed files
with
178 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import shutil | ||
|
||
def move_pdfs(root_folder, destination_folder): | ||
# 遍历根目录及其子目录中的所有文件 | ||
for root, dirs, files in os.walk(root_folder): | ||
for file in files: | ||
if file.endswith('.pdf'): | ||
# 构建完整的文件路径 | ||
src_path = os.path.join(root, file) | ||
# 构建目标路径 | ||
dst_path = os.path.join(destination_folder, file) | ||
|
||
# 移动文件 | ||
shutil.move(src_path, dst_path) | ||
print(f'Moved {file} to {destination_folder}') | ||
|
||
# 使用方法 | ||
root_folder = r'D:\mineru\datasets\datasets' # 源文件夹路径 | ||
destination_folder = r'D:\mineru\datasets\pdf' # 目标文件夹路径 | ||
|
||
# 创建目标文件夹如果不存在 | ||
if not os.path.exists(destination_folder): | ||
os.makedirs(destination_folder) | ||
|
||
move_pdfs(root_folder, destination_folder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
test performance | ||
""" | ||
import os | ||
import shutil | ||
import json | ||
from lib import calculate_score | ||
import pytest | ||
from conf import conf | ||
|
||
code_path = os.environ.get('GITHUB_WORKSPACE') | ||
pdf_dev_path = conf.conf["pdf_dev_path"] | ||
pdf_res_path = conf.conf["pdf_res_path"] | ||
|
||
class TestTable(): | ||
""" | ||
test table | ||
""" | ||
def test_perf_close_table(self): | ||
""" | ||
test perf when close table | ||
""" | ||
|
||
|
||
|
||
|
||
def get_score(): | ||
""" | ||
get score | ||
""" | ||
score = calculate_score.Scoring(os.path.join(pdf_dev_path, "result.json")) | ||
score.calculate_similarity_total("mineru", pdf_dev_path) | ||
res = score.summary_scores() | ||
return res | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
test table case | ||
""" | ||
import os | ||
import shutil | ||
import json | ||
from lib import calculate_score | ||
import pytest | ||
from conf import conf | ||
|
||
code_path = os.environ.get('GITHUB_WORKSPACE') | ||
pdf_dev_path = conf.conf["pdf_dev_path"] | ||
pdf_res_path = conf.conf["pdf_res_path"] | ||
|
||
class TestTable(): | ||
""" | ||
test table | ||
""" | ||
def test_paddle_table_master_cuda(self): | ||
""" | ||
select table: paddle table master,mode is cuda | ||
""" | ||
def test_paddle_table_master_cpu(self): | ||
""" | ||
select table: paddle table master, mode is cpu | ||
""" | ||
def test_st_table_cuda(self): | ||
""" | ||
select table: ST, mode is cuda | ||
""" | ||
|
||
def test_st_table_cpu(self): | ||
""" | ||
select table: ST, mode is cpu | ||
""" | ||
|
||
def test_close_table_cuda(self): | ||
""" | ||
close table, mode is cuda | ||
""" | ||
|
||
|
||
|
||
|
||
def get_score(): | ||
""" | ||
get score | ||
""" | ||
score = calculate_score.Scoring(os.path.join(pdf_dev_path, "result.json")) | ||
score.calculate_similarity_total("mineru", pdf_dev_path) | ||
res = score.summary_scores() | ||
return res | ||
|
||
|
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters