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
11462061
Commit
11462061
authored
Apr 23, 2024
by
赵小蒙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix annotation
parent
3f062ad7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ocr_dict_merge.py
magic_pdf/pre_proc/ocr_dict_merge.py
+2
-2
No files found.
magic_pdf/pre_proc/ocr_dict_merge.py
View file @
11462061
...
...
@@ -120,14 +120,14 @@ def sort_blocks_by_layout(all_bboxes, layout_bboxes):
# 如果是footnote则跳过
if
block
[
7
]
==
BlockType
.
Footnote
:
continue
block_bbox
=
[
block
[
0
],
block
[
1
],
block
[
2
],
block
[
3
]
]
block_bbox
=
block
[:
4
]
if
calculate_overlap_area_in_bbox1_area_ratio
(
block_bbox
,
layout_bbox
)
>
0.8
:
layout_blocks
.
append
(
block
)
# 如果layout_blocks不为空,则放入new_blocks中
if
len
(
layout_blocks
)
>
0
:
new_blocks
.
append
(
layout_blocks
)
# 从
spans删除已经放入layout_sapns中的span
# 从
all_bboxes删除已经放入layout_blocks中的block
for
layout_block
in
layout_blocks
:
all_bboxes
.
remove
(
layout_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