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
fbf1c4bf
"vscode:/vscode.git/clone" did not exist on "43979c2890134fb66e913f7fd5d65b1213ce8c72"
Commit
fbf1c4bf
authored
Jan 20, 2025
by
陆逊
Browse files
Fix ocr utills
parent
69273e96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
+13
-13
No files found.
magic_pdf/model/sub_modules/ocr/paddleocr/ocr_utils.py
View file @
fbf1c4bf
...
...
@@ -330,19 +330,19 @@ def onnx_model_init(key):
import
importlib.resources
resource_path
=
importlib
.
resources
.
path
(
'rapidocr_onnxruntime.models'
,
''
)
onnx_model
=
None
additional_ocr_params
=
{
"use_onnx"
:
True
,
"det
_model_dir"
:
f
'
{
resource_path
}
/ch_PP-OCRv4_
det
_infer.onnx'
,
"rec
_model_dir"
:
f
'
{
resource_path
}
/ch_
PP-OCRv4_rec
_infer.onnx'
,
"cls_mo
de
l
_d
ir"
:
f
'
{
resource_path
}
/ch_ppocr_mobile_v2.0_cls_infer.onnx'
,
"det_db_box_thresh
"
:
key
[
1
],
"use_dil
atio
n
"
:
key
[
2
],
"det_db_unclip_ratio"
:
key
[
3
],
}
# logger.info(f"additional_ocr_params: {additional_ocr_params}")
with
importlib
.
resources
.
path
(
'rapidocr_onnxruntime.models'
,
''
)
as
resource_path
:
onnx_model
=
None
additional_ocr_params
=
{
"use_onnx"
:
True
,
"det_model_dir"
:
f
'
{
resource_path
}
/ch_PP-OCRv4_det_infer.onnx'
,
"rec
_model_dir"
:
f
'
{
resource_path
}
/ch_PP-OCRv4_
rec
_infer.onnx'
,
"cls
_model_dir"
:
f
'
{
resource_path
}
/ch_
ppocr_mobile_v2.0_cls
_infer.onnx'
,
"
de
t
_d
b_box_thresh"
:
key
[
1
]
,
"use_dilation
"
:
key
[
2
],
"det_db_unclip_r
atio"
:
key
[
3
],
}
# logger.info(f"additional_ocr_params: {additional_ocr_params}")
if
key
[
0
]
is
not
None
:
additional_ocr_params
[
"lang"
]
=
key
[
0
]
...
...
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