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
2813e599
Unverified
Commit
2813e599
authored
Apr 08, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Apr 08, 2025
Browse files
Merge pull request #2151 from myhloli/dev
refactor(ocr): improve OCR score precision to three decimal places
parents
098cf1df
ea730ae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
magic_pdf/model/batch_analyze.py
magic_pdf/model/batch_analyze.py
+1
-1
magic_pdf/pdf_parse_union_core_v2.py
magic_pdf/pdf_parse_union_core_v2.py
+1
-1
No files found.
magic_pdf/model/batch_analyze.py
View file @
2813e599
...
...
@@ -241,7 +241,7 @@ class BatchAnalyze:
for
index
,
layout_res_item
in
enumerate
(
need_ocr_lists_by_lang
[
lang
]):
ocr_text
,
ocr_score
=
ocr_res_list
[
index
]
layout_res_item
[
'text'
]
=
ocr_text
layout_res_item
[
'score'
]
=
float
(
round
(
ocr_score
,
2
)
)
layout_res_item
[
'score'
]
=
float
(
f
"
{
ocr_score
:.
3
f
}
"
)
total_processed
+=
len
(
img_crop_list
)
...
...
magic_pdf/pdf_parse_union_core_v2.py
View file @
2813e599
...
...
@@ -997,7 +997,7 @@ def pdf_parse_union(
for
index
,
span
in
enumerate
(
need_ocr_list
):
ocr_text
,
ocr_score
=
ocr_res_list
[
index
]
span
[
'content'
]
=
ocr_text
span
[
'score'
]
=
float
(
round
(
ocr_score
,
2
)
)
span
[
'score'
]
=
float
(
f
"
{
ocr_score
:.
3
f
}
"
)
# rec_time = time.time() - rec_start
# logger.info(f'ocr-dynamic-rec time: {round(rec_time, 2)}, total images processed: {len(img_crop_list)}')
...
...
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