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
962a3453
Commit
962a3453
authored
Jul 01, 2025
by
myhloli
Browse files
fix: adjust OCR confidence threshold and refine category assignment logic
parent
5b6d27d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
mineru/backend/pipeline/batch_analyze.py
mineru/backend/pipeline/batch_analyze.py
+7
-0
mineru/utils/ocr_utils.py
mineru/utils/ocr_utils.py
+1
-1
No files found.
mineru/backend/pipeline/batch_analyze.py
View file @
962a3453
...
...
@@ -318,6 +318,13 @@ class BatchAnalyze:
layout_res_item
[
'score'
]
=
float
(
f
"
{
ocr_score
:.
3
f
}
"
)
if
ocr_score
<
OcrConfidence
.
min_confidence
:
layout_res_item
[
'category_id'
]
=
16
else
:
layout_res_bbox
=
[
layout_res_item
[
'poly'
][
0
],
layout_res_item
[
'poly'
][
1
],
layout_res_item
[
'poly'
][
4
],
layout_res_item
[
'poly'
][
5
]]
layout_res_width
=
layout_res_bbox
[
2
]
-
layout_res_bbox
[
0
]
layout_res_height
=
layout_res_bbox
[
3
]
-
layout_res_bbox
[
1
]
if
ocr_text
in
[
'(204号'
,
'(20'
,
'(2'
,
'(2号'
]
and
ocr_score
<
0.8
and
layout_res_width
<
layout_res_height
:
layout_res_item
[
'category_id'
]
=
16
total_processed
+=
len
(
img_crop_list
)
...
...
mineru/utils/ocr_utils.py
View file @
962a3453
...
...
@@ -5,7 +5,7 @@ import numpy as np
class
OcrConfidence
:
min_confidence
=
0.6
8
min_confidence
=
0.6
min_width
=
3
...
...
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