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
zhougaofeng
magic_pdf
Commits
0135861f
Commit
0135861f
authored
Oct 25, 2024
by
zhougaofeng
Browse files
Update doc_analyze_by_custom_model.py
parent
554e45af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
magic_pdf/model/doc_analyze_by_custom_model.py
magic_pdf/model/doc_analyze_by_custom_model.py
+2
-2
No files found.
magic_pdf/model/doc_analyze_by_custom_model.py
View file @
0135861f
...
...
@@ -127,14 +127,14 @@ def doc_analyze(pdf_bytes: bytes, ocr: bool = False, show_log: bool = False,
page_width
=
img_dict
[
"width"
]
page_height
=
img_dict
[
"height"
]
if
start_page_id
<=
index
<=
end_page_id
:
result
=
custom_model
(
img
)
result
=
custom_model
(
img
,
index
,
end_page_id
)
else
:
result
=
[]
page_info
=
{
"page_no"
:
index
,
"height"
:
page_height
,
"width"
:
page_width
}
page_dict
=
{
"layout_dets"
:
result
,
"page_info"
:
page_info
}
model_json
.
append
(
page_dict
)
doc_analyze_cost
=
time
.
time
()
-
doc_analyze_start
logger
.
info
(
f
"
doc analyze cost
:
{
doc_analyze_cost
}
"
)
logger
.
info
(
f
"
文件分析提取截图共耗时
:
{
doc_analyze_cost
}
"
)
# logger.info(f'model_json:\n{model_json}')
return
model_json
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