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
04020101
authored
2020-10-17 19:07:16 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix skip img
1 parent
2290e6cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
src/apps/doc/management/commands/doc_ocr_process.py
src/apps/doc/ocr/wb.py
src/apps/doc/management/commands/doc_ocr_process.py
View file @
0402010
...
...
@@ -147,11 +147,10 @@ class Command(BaseCommand, LoggerMixin):
if
summary
[
6
]
is
not
None
:
ed_list
.
append
(
summary
[
6
])
@staticmethod
def
license1_process
(
ocr_data
,
license_summary
,
classify
,
skip_img
,
img_path
):
def
license1_process
(
self
,
ocr_data
,
license_summary
,
classify
,
skip_img
,
img_path
):
license_data
=
ocr_data
.
get
(
'data'
,
[])
if
not
license_data
:
skip_img
.
append
(
img_path
)
skip_img
.
append
(
self
.
parse_img_path
(
img_path
)
)
return
for
license_dict
in
license_data
:
res_list
=
[]
...
...
@@ -537,8 +536,9 @@ class Command(BaseCommand, LoggerMixin):
merged_bs_summary
=
self
.
rebuild_bs_summary
(
bs_summary
,
unknown_summary
)
self
.
cronjob_log
.
info
(
'{0} [business_type={1}] [doc_id={2}] [merged_bs_summary={3}] '
'[unknown_summary={4}]'
.
format
(
self
.
log_base
,
business_type
,
doc
.
id
,
merged_bs_summary
,
unknown_summary
))
'[unknown_summary={4}] [skip_img={5}]'
.
format
(
self
.
log_base
,
business_type
,
doc
.
id
,
merged_bs_summary
,
unknown_summary
,
skip_img
))
del
unknown_summary
# 4.2 重构Excel文件
...
...
src/apps/doc/ocr/wb.py
View file @
0402010
...
...
@@ -249,7 +249,7 @@ class BSWorkbook(Workbook):
except
Exception
as
e
:
continue
else
:
over_cell
.
number_format
=
numbers
.
FORMAT_
GENERAL
over_cell
.
number_format
=
numbers
.
FORMAT_
NUMBER_COMMA_SEPARATED1
# 3.4.金额转数值
try
:
...
...
@@ -271,7 +271,7 @@ class BSWorkbook(Workbook):
else
:
if
rows
[
consts
.
BORROW_IDX
]
.
value
in
consts
.
BORROW_OUTLAY_SET
:
amount_cell
.
value
=
-
amount_cell
.
value
amount_cell
.
number_format
=
numbers
.
FORMAT_
GENERAL
amount_cell
.
number_format
=
numbers
.
FORMAT_
NUMBER_COMMA_SEPARATED1
same_amount_mapping
=
amount_mapping
.
get
(
date_cell
.
value
,
{})
fill_rows
=
same_amount_mapping
.
get
(
-
amount_cell
.
value
)
if
fill_rows
:
...
...
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