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
bf18172d
Commit
bf18172d
authored
Jun 11, 2024
by
赵小蒙
Browse files
update: model parse support paddle output
parent
e92de758
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
magic_pdf/model/magic_model.py
magic_pdf/model/magic_model.py
+8
-1
No files found.
magic_pdf/model/magic_model.py
View file @
bf18172d
...
@@ -37,7 +37,14 @@ class MagicModel:
...
@@ -37,7 +37,14 @@ class MagicModel:
)
)
layout_dets
=
model_page_info
[
"layout_dets"
]
layout_dets
=
model_page_info
[
"layout_dets"
]
for
layout_det
in
layout_dets
:
for
layout_det
in
layout_dets
:
x0
,
y0
,
_
,
_
,
x1
,
y1
,
_
,
_
=
layout_det
[
"poly"
]
if
layout_det
.
get
(
"bbox"
)
is
not
None
:
# 兼容直接输出bbox的模型数据,如paddle
x0
,
y0
,
x1
,
y1
=
layout_det
[
"bbox"
]
else
:
# 兼容直接输出poly的模型数据,如xxx
x0
,
y0
,
_
,
_
,
x1
,
y1
,
_
,
_
=
layout_det
[
"poly"
]
bbox
=
[
bbox
=
[
int
(
x0
/
horizontal_scale_ratio
),
int
(
x0
/
horizontal_scale_ratio
),
int
(
y0
/
vertical_scale_ratio
),
int
(
y0
/
vertical_scale_ratio
),
...
...
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