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
73c957c3
authored
2021-09-03 10:18:04 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
contract part 1
1 parent
19f10814
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/consts.py
View file @
73c957c
...
...
@@ -1002,6 +1002,10 @@ JYPZ_FIELD_ORDER = (("type", "标题"),
(
"stamp_signature_seller"
,
"出卖方签字/盖章"
),
(
"stamp_signature_agent"
,
"经销商签字/盖章"
),)
# 合同
CONTRACT_CN_NAME
=
'合同'
CONTRACT_CLASSIFY
=
41
SUCCESS_CODE_SET
=
{
'0'
,
0
}
FIELD_ORDER_MAP
=
{
...
...
src/apps/doc/management/commands/ocr_process.py
View file @
73c957c
...
...
@@ -207,6 +207,9 @@ class Command(BaseCommand, LoggerMixin):
else
:
res_list
.
append
((
pno
,
ino
,
part_idx
,
consts
.
RES_SUCCESS_EMPTY
))
def
contract_process
(
self
,
ocr_data
,
contract_result
,
res_list
,
pno
,
ino
,
part_idx
,
img_path
):
pass
def
license1_process
(
self
,
ocr_data
,
license_summary
,
classify
,
res_list
,
pno
,
ino
,
part_idx
,
img_path
,
do_dda
,
dda_id_bc_mapping
):
# 类别:'0'身份证, '1'居住证
license_data
=
ocr_data
.
get
(
'data'
)
...
...
@@ -820,6 +823,7 @@ class Command(BaseCommand, LoggerMixin):
bs_summary
=
{}
unknown_summary
=
{}
license_summary
=
{}
contract_result
=
{}
res_list
=
[]
interest_keyword
=
Keywords
.
objects
.
filter
(
type
=
KeywordsType
.
INTEREST
.
value
,
on_off
=
True
)
.
values_list
(
'keyword'
,
flat
=
True
)
...
...
@@ -907,6 +911,9 @@ class Command(BaseCommand, LoggerMixin):
res_list
.
append
((
pno
,
ino
,
part_idx
,
consts
.
RES_FAILED_2
))
self
.
online_log
.
warn
(
'{0} [ocr_2 failed] [img_path={1}]'
.
format
(
self
.
log_base
,
img_path
))
elif
classify
==
consts
.
CONTRACT_CLASSIFY
:
self
.
contract_process
(
ocr_data
,
contract_result
,
res_list
,
pno
,
ino
,
part_idx
,
img_path
)
else
:
# 流水处理
bs_classify_set
.
add
(
classify
)
self
.
bs_process
(
wb
,
ocr_data
,
bs_summary
,
unknown_summary
,
classify
,
res_list
,
pno
,
ino
,
part_idx
)
...
...
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