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
fc234831
Unverified
Commit
fc234831
authored
Apr 23, 2024
by
myhloli
Committed by
GitHub
Apr 23, 2024
Browse files
Merge pull request #62 from myhloli/master
update confidence score 0.95->0.05
parents
ec2cbddc
11462061
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
magic_pdf/model/magic_model.py
magic_pdf/model/magic_model.py
+1
-1
magic_pdf/pre_proc/ocr_dict_merge.py
magic_pdf/pre_proc/ocr_dict_merge.py
+2
-2
No files found.
magic_pdf/model/magic_model.py
View file @
fc234831
...
@@ -48,7 +48,7 @@ class MagicModel:
...
@@ -48,7 +48,7 @@ class MagicModel:
need_remove_list
=
[]
need_remove_list
=
[]
layout_dets
=
model_page_info
[
"layout_dets"
]
layout_dets
=
model_page_info
[
"layout_dets"
]
for
layout_det
in
layout_dets
:
for
layout_det
in
layout_dets
:
if
layout_det
[
"score"
]
<
0.
9
5
:
if
layout_det
[
"score"
]
<
=
0.
0
5
:
need_remove_list
.
append
(
layout_det
)
need_remove_list
.
append
(
layout_det
)
else
:
else
:
continue
continue
...
...
magic_pdf/pre_proc/ocr_dict_merge.py
View file @
fc234831
...
@@ -120,14 +120,14 @@ def sort_blocks_by_layout(all_bboxes, layout_bboxes):
...
@@ -120,14 +120,14 @@ def sort_blocks_by_layout(all_bboxes, layout_bboxes):
# 如果是footnote则跳过
# 如果是footnote则跳过
if
block
[
7
]
==
BlockType
.
Footnote
:
if
block
[
7
]
==
BlockType
.
Footnote
:
continue
continue
block_bbox
=
[
block
[
0
],
block
[
1
],
block
[
2
],
block
[
3
]
]
block_bbox
=
block
[
:
4
]
if
calculate_overlap_area_in_bbox1_area_ratio
(
block_bbox
,
layout_bbox
)
>
0.8
:
if
calculate_overlap_area_in_bbox1_area_ratio
(
block_bbox
,
layout_bbox
)
>
0.8
:
layout_blocks
.
append
(
block
)
layout_blocks
.
append
(
block
)
# 如果layout_blocks不为空,则放入new_blocks中
# 如果layout_blocks不为空,则放入new_blocks中
if
len
(
layout_blocks
)
>
0
:
if
len
(
layout_blocks
)
>
0
:
new_blocks
.
append
(
layout_blocks
)
new_blocks
.
append
(
layout_blocks
)
# 从
span
s删除已经放入layout_
sapns中的span
# 从
all_bboxe
s删除已经放入layout_
blocks中的block
for
layout_block
in
layout_blocks
:
for
layout_block
in
layout_blocks
:
all_bboxes
.
remove
(
layout_block
)
all_bboxes
.
remove
(
layout_block
)
...
...
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