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
9cc53a5e
Commit
9cc53a5e
authored
Mar 12, 2024
by
赵小蒙
Browse files
更新清除重叠span的逻辑
parent
72b7894c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
magic_pdf/libs/boxbase.py
magic_pdf/libs/boxbase.py
+5
-4
No files found.
magic_pdf/libs/boxbase.py
View file @
9cc53a5e
...
@@ -210,10 +210,11 @@ def get_minbox_if_overlap_by_ratio(bbox1, bbox2, ratio):
...
@@ -210,10 +210,11 @@ def get_minbox_if_overlap_by_ratio(bbox1, bbox2, ratio):
area1
=
(
x1_max
-
x1_min
)
*
(
y1_max
-
y1_min
)
area1
=
(
x1_max
-
x1_min
)
*
(
y1_max
-
y1_min
)
area2
=
(
x2_max
-
x2_min
)
*
(
y2_max
-
y2_min
)
area2
=
(
x2_max
-
x2_min
)
*
(
y2_max
-
y2_min
)
overlap_ratio
=
calculate_overlap_area_2_minbox_area_ratio
(
bbox1
,
bbox2
)
overlap_ratio
=
calculate_overlap_area_2_minbox_area_ratio
(
bbox1
,
bbox2
)
if
overlap_ratio
>
ratio
and
area1
<
area2
:
if
overlap_ratio
>
ratio
:
return
bbox1
if
area1
<=
area2
:
elif
overlap_ratio
>
ratio
and
area2
<
area1
:
return
bbox1
return
bbox2
else
:
return
bbox2
else
:
else
:
return
None
return
None
...
...
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