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
f09c1cd2
Unverified
Commit
f09c1cd2
authored
Nov 28, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 28, 2024
Browse files
Merge pull request #1130 from myhloli/dev
fix(lite_model): Adapt iite Mode to the Hybrid OCR Mode in Version 0.10
parents
89c7bd04
9b4d77dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
magic_pdf/model/pp_structure_v2.py
magic_pdf/model/pp_structure_v2.py
+23
-3
No files found.
magic_pdf/model/pp_structure_v2.py
View file @
f09c1cd2
...
@@ -18,11 +18,31 @@ def region_to_bbox(region):
...
@@ -18,11 +18,31 @@ def region_to_bbox(region):
class
CustomPaddleModel
:
class
CustomPaddleModel
:
def
__init__
(
self
,
ocr
:
bool
=
False
,
show_log
:
bool
=
False
,
lang
=
None
):
def
__init__
(
self
,
ocr
:
bool
=
False
,
show_log
:
bool
=
False
,
lang
=
None
,
det_db_box_thresh
=
0.3
,
use_dilation
=
True
,
det_db_unclip_ratio
=
1.8
):
if
lang
is
not
None
:
if
lang
is
not
None
:
self
.
model
=
PPStructure
(
table
=
False
,
ocr
=
ocr
,
show_log
=
show_log
,
lang
=
lang
)
self
.
model
=
PPStructure
(
table
=
False
,
ocr
=
True
,
show_log
=
show_log
,
lang
=
lang
,
det_db_box_thresh
=
det_db_box_thresh
,
use_dilation
=
use_dilation
,
det_db_unclip_ratio
=
det_db_unclip_ratio
,
)
else
:
else
:
self
.
model
=
PPStructure
(
table
=
False
,
ocr
=
ocr
,
show_log
=
show_log
)
self
.
model
=
PPStructure
(
table
=
False
,
ocr
=
True
,
show_log
=
show_log
,
det_db_box_thresh
=
det_db_box_thresh
,
use_dilation
=
use_dilation
,
det_db_unclip_ratio
=
det_db_unclip_ratio
,
)
def
__call__
(
self
,
img
):
def
__call__
(
self
,
img
):
try
:
try
:
...
...
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