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
514a5718
Commit
514a5718
authored
Mar 12, 2024
by
liukaiwen
Browse files
Merge branch 'master' into dev-in-line-bbox
parents
94a7ba3d
1d59509d
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 @
514a5718
...
...
@@ -210,10 +210,11 @@ def get_minbox_if_overlap_by_ratio(bbox1, bbox2, ratio):
area1
=
(
x1_max
-
x1_min
)
*
(
y1_max
-
y1_min
)
area2
=
(
x2_max
-
x2_min
)
*
(
y2_max
-
y2_min
)
overlap_ratio
=
calculate_overlap_area_2_minbox_area_ratio
(
bbox1
,
bbox2
)
if
overlap_ratio
>
ratio
and
area1
<
area2
:
return
bbox1
elif
overlap_ratio
>
ratio
and
area2
<
area1
:
return
bbox2
if
overlap_ratio
>
ratio
:
if
area1
<=
area2
:
return
bbox1
else
:
return
bbox2
else
:
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