Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
fe34b1a2
Commit
fe34b1a2
authored
May 10, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
magic_model return block with scroe
parent
536300fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
magic_model.py
magic_pdf/model/magic_model.py
+6
-3
No files found.
magic_pdf/model/magic_model.py
View file @
fe34b1a2
...
...
@@ -45,8 +45,8 @@ class MagicModel:
int
(
y1
/
vertical_scale_ratio
),
]
layout_det
[
"bbox"
]
=
bbox
# 删除高度或者宽度
为
0的spans
if
bbox
[
2
]
-
bbox
[
0
]
==
0
or
bbox
[
3
]
-
bbox
[
1
]
=
=
0
:
# 删除高度或者宽度
小于等于
0的spans
if
bbox
[
2
]
-
bbox
[
0
]
<=
0
or
bbox
[
3
]
-
bbox
[
1
]
<
=
0
:
need_remove_list
.
append
(
layout_det
)
for
need_remove
in
need_remove_list
:
layout_dets
.
remove
(
need_remove
)
...
...
@@ -546,7 +546,10 @@ class MagicModel:
bbox
=
item
.
get
(
"bbox"
,
None
)
if
category_id
==
type
:
block
=
{
"bbox"
:
bbox
}
block
=
{
"bbox"
:
bbox
,
"score"
:
item
.
get
(
"score"
),
}
for
col
in
extra_col
:
block
[
col
]
=
item
.
get
(
col
,
None
)
blocks
.
append
(
block
)
...
...
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