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
f20ab37d
Unverified
Commit
f20ab37d
authored
Mar 03, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Mar 03, 2025
Browse files
Merge pull request #1822 from icecraft/fix/caption_match
fix: caption match
parents
98adcbb9
fb02be19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
magic_pdf/model/magic_model.py
magic_pdf/model/magic_model.py
+1
-2
No files found.
magic_pdf/model/magic_model.py
View file @
f20ab37d
...
@@ -528,14 +528,13 @@ class MagicModel:
...
@@ -528,14 +528,13 @@ class MagicModel:
pair_dis
=
bbox_distance
(
subjects
[
sub_idx
][
'bbox'
],
objects
[
obj_idx
][
'bbox'
])
pair_dis
=
bbox_distance
(
subjects
[
sub_idx
][
'bbox'
],
objects
[
obj_idx
][
'bbox'
])
nearest_dis
=
float
(
'inf'
)
nearest_dis
=
float
(
'inf'
)
for
i
in
range
(
N
):
for
i
in
range
(
N
):
if
i
in
seen_idx
:
continue
if
i
in
seen_idx
or
i
==
sub_idx
:
continue
nearest_dis
=
min
(
nearest_dis
,
bbox_distance
(
subjects
[
i
][
'bbox'
],
objects
[
obj_idx
][
'bbox'
]))
nearest_dis
=
min
(
nearest_dis
,
bbox_distance
(
subjects
[
i
][
'bbox'
],
objects
[
obj_idx
][
'bbox'
]))
if
pair_dis
>=
3
*
nearest_dis
:
if
pair_dis
>=
3
*
nearest_dis
:
seen_idx
.
add
(
sub_idx
)
seen_idx
.
add
(
sub_idx
)
continue
continue
seen_idx
.
add
(
sub_idx
)
seen_idx
.
add
(
sub_idx
)
seen_idx
.
add
(
obj_idx
+
OBJ_IDX_OFFSET
)
seen_idx
.
add
(
obj_idx
+
OBJ_IDX_OFFSET
)
seen_sub_idx
.
add
(
sub_idx
)
seen_sub_idx
.
add
(
sub_idx
)
...
...
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