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
9675a574
Unverified
Commit
9675a574
authored
Nov 26, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 26, 2024
Browse files
Merge pull request #1088 from myhloli/dev
feat(ocr): filter out low confidence ocr results
parents
61e88cb2
eb45a0e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
+3
-0
No files found.
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
View file @
9675a574
...
@@ -214,6 +214,9 @@ def get_ocr_result_list(ocr_res, useful_list):
...
@@ -214,6 +214,9 @@ def get_ocr_result_list(ocr_res, useful_list):
if
len
(
box_ocr_res
)
==
2
:
if
len
(
box_ocr_res
)
==
2
:
p1
,
p2
,
p3
,
p4
=
box_ocr_res
[
0
]
p1
,
p2
,
p3
,
p4
=
box_ocr_res
[
0
]
text
,
score
=
box_ocr_res
[
1
]
text
,
score
=
box_ocr_res
[
1
]
# logger.info(f"text: {text}, score: {score}")
if
score
<
0.6
:
# 过滤低置信度的结果
continue
else
:
else
:
p1
,
p2
,
p3
,
p4
=
box_ocr_res
p1
,
p2
,
p3
,
p4
=
box_ocr_res
text
,
score
=
""
,
1
text
,
score
=
""
,
1
...
...
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