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
df15393c
"vscode:/vscode.git/clone" did not exist on "312b09e23d332a95f8f5b1310e7bf38e53d16da2"
Commit
df15393c
authored
Jul 03, 2025
by
myhloli
Browse files
refactor: optimize overlap detection logic in block_pre_proc.py for efficiency
parent
cd78980c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
mineru/utils/block_pre_proc.py
mineru/utils/block_pre_proc.py
+26
-25
No files found.
mineru/utils/block_pre_proc.py
View file @
df15393c
...
...
@@ -213,9 +213,10 @@ def remove_overlaps_min_blocks(all_bboxes):
# 重叠block,小的不能直接删除,需要和大的那个合并成一个更大的。
# 删除重叠blocks中较小的那些
need_remove
=
[]
for
block1
in
all_bboxes
:
for
block2
in
all_bboxes
:
if
block1
!=
block2
:
for
i
in
range
(
len
(
all_bboxes
)):
for
j
in
range
(
i
+
1
,
len
(
all_bboxes
)):
block1
=
all_bboxes
[
i
]
block2
=
all_bboxes
[
j
]
block1_bbox
=
block1
[:
4
]
block2_bbox
=
block2
[:
4
]
overlap_box
=
get_minbox_if_overlap_by_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