Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
f2169686
Unverified
Commit
f2169686
authored
Apr 22, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Apr 22, 2025
Browse files
Merge pull request #2314 from myhloli/dev
refactor(table): replace ocr_engine with lang in table model prediction
parents
012327ba
9c4e779b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
README.md
README.md
+3
-0
README_zh-CN.md
README_zh-CN.md
+3
-0
magic_pdf/model/batch_analyze.py
magic_pdf/model/batch_analyze.py
+1
-8
magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorch_paddle.py
...model/sub_modules/ocr/paddleocr2pytorch/pytorch_paddle.py
+5
-0
No files found.
README.md
View file @
f2169686
...
...
@@ -48,6 +48,9 @@ Easier to use: Just grab MinerU Desktop. No coding, no login, just a simple inte
</div>
# Changelog
-
2025/04/22 1.3.7 Released
-
Fixed the issue where the
`lang`
parameter was ineffective during table parsing model initialization.
-
Fixed the significant slowdown in OCR and table parsing speed in
`cpu`
mode.
-
2025/04/16 1.3.4 Released
-
Slightly improved the speed of OCR detection by removing some unused blocks.
-
Fixed page-level sorting errors caused by footnotes in certain cases.
...
...
README_zh-CN.md
View file @
f2169686
...
...
@@ -47,6 +47,9 @@
</div>
# 更新记录
-
2025/04/22 1.3.7 发布
-
修复表格解析模型初始化时lang参数失效的问题
-
修复在
`cpu`
模式下ocr和表格解析速度大幅下降的问题
-
2025/04/16 1.3.4 发布
-
通过移除一些无用的块,小幅提升了ocr-det的速度
-
修复部分情况下由footnote导致的页面内排序错误
...
...
magic_pdf/model/batch_analyze.py
View file @
f2169686
...
...
@@ -161,20 +161,13 @@ class BatchAnalyze:
for
table_res_dict
in
tqdm
(
table_res_list_all_page
,
desc
=
"Table Predict"
):
_lang
=
table_res_dict
[
'lang'
]
atom_model_manager
=
AtomModelSingleton
()
ocr_engine
=
atom_model_manager
.
get_atom_model
(
atom_model_name
=
'ocr'
,
ocr_show_log
=
False
,
det_db_box_thresh
=
0.5
,
det_db_unclip_ratio
=
1.6
,
lang
=
_lang
)
table_model
=
atom_model_manager
.
get_atom_model
(
atom_model_name
=
'table'
,
table_model_name
=
'rapid_table'
,
table_model_path
=
''
,
table_max_time
=
400
,
device
=
'cpu'
,
ocr_engine
=
ocr_engine
,
lang
=
_lang
,
table_sub_model_name
=
'slanet_plus'
)
html_code
,
table_cell_bboxes
,
logic_points
,
elapse
=
table_model
.
predict
(
table_res_dict
[
'table_img'
])
...
...
magic_pdf/model/sub_modules/ocr/paddleocr2pytorch/pytorch_paddle.py
View file @
f2169686
...
...
@@ -53,6 +53,11 @@ class PytorchPaddleOCR(TextSystem):
args
=
parser
.
parse_args
(
args
)
self
.
lang
=
kwargs
.
get
(
'lang'
,
'ch'
)
device
=
get_device
()
if
device
==
'cpu'
and
self
.
lang
==
'ch'
:
self
.
lang
=
'ch_lite'
if
self
.
lang
in
latin_lang
:
self
.
lang
=
'latin'
elif
self
.
lang
in
arabic_lang
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment