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
ab6cb70f
Commit
ab6cb70f
authored
Dec 31, 2024
by
zhougaofeng
Browse files
Update cut_image.py
parent
e1c7a886
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
magic_pdf/pre_proc/cut_image.py
magic_pdf/pre_proc/cut_image.py
+1
-2
No files found.
magic_pdf/pre_proc/cut_image.py
View file @
ab6cb70f
...
@@ -24,7 +24,7 @@ def ocr_image(image_path,compress_image):
...
@@ -24,7 +24,7 @@ def ocr_image(image_path,compress_image):
logger
.
info
(
f
'qwen解析
{
image_path
}
表格的内容为:
{
generated_text
}
,耗时为:
{
end
-
start
}
'
)
logger
.
info
(
f
'qwen解析
{
image_path
}
表格的内容为:
{
generated_text
}
,耗时为:
{
end
-
start
}
'
)
return
generated_text
return
generated_text
def
ocr_cut_image_and_table
(
config_path
,
local_image_dir
,
spans
,
page
,
page_id
,
pdf_bytes_md5
,
imageWriter
):
def
ocr_cut_image_and_table
(
ocr_status
,
config_path
,
local_image_dir
,
spans
,
page
,
page_id
,
pdf_bytes_md5
,
imageWriter
):
def
return_path
(
type
):
def
return_path
(
type
):
return
join_path
(
pdf_bytes_md5
,
type
)
return
join_path
(
pdf_bytes_md5
,
type
)
...
@@ -40,7 +40,6 @@ def ocr_cut_image_and_table(config_path,local_image_dir,spans, page, page_id, pd
...
@@ -40,7 +40,6 @@ def ocr_cut_image_and_table(config_path,local_image_dir,spans, page, page_id, pd
url
=
config
.
get
(
'server'
,
'ocr_server'
)
url
=
config
.
get
(
'server'
,
'ocr_server'
)
workers
=
int
(
config
.
get
(
'server'
,
'ocr_workers'
))
workers
=
int
(
config
.
get
(
'server'
,
'ocr_workers'
))
client
=
PredictClient
(
url
)
client
=
PredictClient
(
url
)
ocr_status
=
client
.
check_health
()
pool
=
Pool
(
workers
)
pool
=
Pool
(
workers
)
for
span
in
spans
:
for
span
in
spans
:
...
...
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