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
bc51f9f7
Unverified
Commit
bc51f9f7
authored
Apr 14, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Apr 14, 2025
Browse files
Merge pull request #2214 from myhloli/dev
refactor(footnote_detection): adjust footnote detection threshold
parents
4df8523a
8caf59f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
magic_pdf/pre_proc/ocr_detect_all_bboxes.py
magic_pdf/pre_proc/ocr_detect_all_bboxes.py
+2
-2
No files found.
magic_pdf/pre_proc/ocr_detect_all_bboxes.py
View file @
bc51f9f7
...
@@ -99,11 +99,11 @@ def ocr_prepare_bboxes_for_layout_split_v2(
...
@@ -99,11 +99,11 @@ def ocr_prepare_bboxes_for_layout_split_v2(
all_discarded_blocks
=
[]
all_discarded_blocks
=
[]
add_bboxes
(
discarded_blocks
,
BlockType
.
Discarded
,
all_discarded_blocks
)
add_bboxes
(
discarded_blocks
,
BlockType
.
Discarded
,
all_discarded_blocks
)
"""footnote识别:宽度超过1/3页面宽度的,高度超过10的,处于页面下半
5
0%区域的"""
"""footnote识别:宽度超过1/3页面宽度的,高度超过10的,处于页面下半
3
0%区域的"""
footnote_blocks
=
[]
footnote_blocks
=
[]
for
discarded
in
discarded_blocks
:
for
discarded
in
discarded_blocks
:
x0
,
y0
,
x1
,
y1
=
discarded
[
'bbox'
]
x0
,
y0
,
x1
,
y1
=
discarded
[
'bbox'
]
if
(
x1
-
x0
)
>
(
page_w
/
3
)
and
(
y1
-
y0
)
>
10
and
y0
>
(
page_h
/
2
):
if
(
x1
-
x0
)
>
(
page_w
/
3
)
and
(
y1
-
y0
)
>
10
and
y0
>
(
page_h
*
0.7
):
footnote_blocks
.
append
([
x0
,
y0
,
x1
,
y1
])
footnote_blocks
.
append
([
x0
,
y0
,
x1
,
y1
])
"""移除在footnote下面的任何框"""
"""移除在footnote下面的任何框"""
...
...
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