Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
12319785
authored
2022-01-20 18:28:51 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix ltgt
1 parent
82e1a38f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
8 deletions
src/apps/doc/management/commands/folder_dda_process.py
src/apps/doc/management/commands/folder_ltgt_process.py
src/apps/doc/management/commands/folder_ocr_process.py
src/apps/doc/management/commands/folder_wsc_process.py
src/apps/doc/management/commands/folder_dda_process.py
View file @
1231978
...
...
@@ -386,12 +386,16 @@ class Command(BaseCommand, LoggerMixin):
for
name
in
true_file_set
:
path
=
os
.
path
.
join
(
input_dir
,
name
)
try
:
if
os
.
path
.
isfile
(
path
):
if
not
os
.
path
.
exists
(
path
):
self
.
folder_log
.
info
(
'{0} [path is not exists] [path={1}]'
.
format
(
self
.
log_base
,
path
))
continue
elif
os
.
path
.
isfile
(
path
):
self
.
folder_log
.
info
(
'{0} [file start] [path={1}]'
.
format
(
self
.
log_base
,
path
))
if
name
.
endswith
(
'.pdf'
)
or
name
.
endswith
(
'.PDF'
):
result
=
self
.
pdf_process
(
name
,
path
,
img_output_dir
,
wb_output_dir
,
pdf_output_dir
)
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
):
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
)
or
name
.
endswith
(
'.tiff'
)
or
\
name
.
endswith
(
'.TIFF'
):
result
=
self
.
tif_process
(
name
,
path
,
img_output_dir
,
wb_output_dir
,
tiff_output_dir
)
else
:
...
...
src/apps/doc/management/commands/folder_ltgt_process.py
View file @
1231978
...
...
@@ -561,6 +561,7 @@ class Command(BaseCommand, LoggerMixin):
}
else
:
rebuild_res
=
self
.
images_process
([
path
],
classify
,
excel_path
,
seperate_path_map
)
if
os
.
path
.
exists
(
path
):
shutil
.
move
(
path
,
img_save_path
)
return
rebuild_res
...
...
@@ -690,12 +691,16 @@ class Command(BaseCommand, LoggerMixin):
path
=
os
.
path
.
join
(
input_dir
,
name
)
try
:
if
os
.
path
.
isfile
(
path
):
if
not
os
.
path
.
exists
(
path
):
self
.
folder_log
.
info
(
'{0} [path is not exists] [path={1}]'
.
format
(
self
.
log_base
,
path
))
continue
elif
os
.
path
.
isfile
(
path
):
self
.
folder_log
.
info
(
'{0} [file start] [path={1}]'
.
format
(
self
.
log_base
,
path
))
if
name
.
endswith
(
'.pdf'
)
or
name
.
endswith
(
'.PDF'
):
result
=
self
.
pdf_process
(
name
,
path
,
classify
,
img_output_dir
,
wb_output_dir
,
pdf_output_dir
,
seperate_dir_map
)
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
):
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
)
or
name
.
endswith
(
'.tiff'
)
or
\
name
.
endswith
(
'.TIFF'
):
if
classify
==
consts
.
CONTRACT_CLASSIFY
:
raise
LTGTException
(
'e-contract must be pdf'
)
result
=
self
.
tif_process
(
name
,
path
,
classify
,
img_output_dir
,
wb_output_dir
,
...
...
src/apps/doc/management/commands/folder_ocr_process.py
View file @
1231978
...
...
@@ -340,11 +340,15 @@ class Command(BaseCommand, LoggerMixin):
path
=
os
.
path
.
join
(
input_dir
,
name
)
try
:
if
os
.
path
.
isfile
(
path
):
if
not
os
.
path
.
exists
(
path
):
self
.
folder_log
.
info
(
'{0} [path is not exists] [path={1}]'
.
format
(
self
.
log_base
,
path
))
continue
elif
os
.
path
.
isfile
(
path
):
self
.
folder_log
.
info
(
'{0} [file start] [path={1}]'
.
format
(
self
.
log_base
,
path
))
if
name
.
endswith
(
'.pdf'
)
or
name
.
endswith
(
'.PDF'
):
self
.
pdf_process
(
name
,
path
,
classify
,
img_output_dir
,
wb_output_dir
,
pdf_output_dir
)
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
):
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
)
or
name
.
endswith
(
'.tiff'
)
or
\
name
.
endswith
(
'.TIFF'
):
self
.
tif_process
(
name
,
path
,
classify
,
img_output_dir
,
wb_output_dir
,
tiff_output_dir
)
else
:
self
.
img_process
(
name
,
path
,
classify
,
wb_output_dir
,
img_output_dir
,
pdf_output_dir
)
...
...
src/apps/doc/management/commands/folder_wsc_process.py
View file @
1231978
...
...
@@ -585,11 +585,15 @@ class Command(BaseCommand, LoggerMixin):
path
=
os
.
path
.
join
(
input_dir
,
name
)
try
:
if
os
.
path
.
isfile
(
path
):
if
not
os
.
path
.
exists
(
path
):
self
.
folder_log
.
info
(
'{0} [path is not exists] [path={1}]'
.
format
(
self
.
log_base
,
path
))
continue
elif
os
.
path
.
isfile
(
path
):
self
.
folder_log
.
info
(
'{0} [file start] [path={1}]'
.
format
(
self
.
log_base
,
path
))
if
name
.
endswith
(
'.pdf'
)
or
name
.
endswith
(
'.PDF'
):
self
.
pdf_process
(
name
,
path
,
img_output_dir
,
wb_output_dir
,
pdf_output_dir
)
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
):
elif
name
.
endswith
(
'.tif'
)
or
name
.
endswith
(
'.TIF'
)
or
name
.
endswith
(
'.tiff'
)
or
\
name
.
endswith
(
'.TIFF'
):
self
.
tif_process
(
name
,
path
,
img_output_dir
,
wb_output_dir
,
tiff_output_dir
)
else
:
self
.
folder_log
.
info
(
'{0} [path is not pdf or tif] [path={1}]'
.
format
(
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment