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
47cb7170
authored
2024-05-14 16:10:07 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/fix/20240424'
2 parents
1eb06fcb
6992b281
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/consts.py
View file @
47cb717
...
...
@@ -1675,15 +1675,30 @@ SE_FSM_MSI_MAP = {
'签单日期'
:
(
2
,
'签单日期'
),
}
def
get_page_customer_sign
(
page_no
):
return
(
page_no
,
'客户签名'
)
def
get_page_sign_date
(
page_no
):
return
(
page_no
,
'签单日期'
)
SE_FSM_SC_MAP
=
{
'姓名'
:
(
1
,
'姓名'
),
'证件类型'
:
(
1
,
'证件类型'
),
'证件号码'
:
(
1
,
'证件号码'
),
'总价'
:
(
1
,
'总价'
),
'客户签名'
:
(
12
,
'客户签名'
)
,
'签单日期'
:
(
12
,
'签单日期'
)
,
'客户签名'
:
get_page_customer_sign
,
'签单日期'
:
get_page_sign_date
,
}
# SE_FSM_SC_MAP = {
# '姓名': (1, '姓名'),
# '证件类型': (1, '证件类型'),
# '证件号码': (1, '证件号码'),
# '总价': (1, '总价'),
# '客户签名': (12, '客户签名'),
# '签单日期': (12, '签单日期'),
# }
SE_FSM_SC2_MAP
=
{
'姓名'
:
(
1
,
'姓名'
),
'证件类型'
:
(
1
,
'证件类型'
),
...
...
src/apps/doc/management/commands/ocr_process.py
View file @
47cb717
...
...
@@ -1030,10 +1030,23 @@ class Command(BaseCommand, LoggerMixin):
elif
classify
in
consts
.
SE_FSM_CON_MAP
:
res
=
{}
for
key
,
(
pno1
,
key1
)
in
consts
.
SE_FSM_CON_MAP
[
classify
]
.
items
():
# for key, (pno1, key1) in consts.SE_FSM_CON_MAP[classify].items():
# res[key] = page_info_dict.get(str(pno1), {}).get(key1)
# res.setdefault(consts.IMG_PATH_KEY, dict())[key] = page_info_dict.get(str(pno1), {}).get(
# consts.IMG_PATH_KEY, '')
# license_summary[classify] = [res]
for
key
,
value
in
consts
.
SE_FSM_CON_MAP
[
classify
]
.
items
():
if
callable
(
value
):
for
page_no
in
page_info_dict
.
keys
():
if
page_no
!=
'is_asp'
and
page_no
!=
'1'
:
pno1
,
key1
=
value
(
int
(
page_no
))
res
[
key
]
=
page_info_dict
.
get
(
str
(
pno1
),
{})
.
get
(
key1
)
res
.
setdefault
(
consts
.
IMG_PATH_KEY
,
dict
())[
key
]
=
page_info_dict
.
get
(
str
(
pno1
),
{})
.
get
(
consts
.
IMG_PATH_KEY
,
''
)
res
.
setdefault
(
consts
.
IMG_PATH_KEY
,
dict
())[
key
]
=
page_info_dict
.
get
(
str
(
pno1
),
{})
.
get
(
consts
.
IMG_PATH_KEY
,
''
)
else
:
pno1
,
key1
=
value
res
[
key
]
=
page_info_dict
.
get
(
str
(
pno1
),
{})
.
get
(
key1
)
res
.
setdefault
(
consts
.
IMG_PATH_KEY
,
dict
())[
key
]
=
page_info_dict
.
get
(
str
(
pno1
),
{})
.
get
(
consts
.
IMG_PATH_KEY
,
''
)
license_summary
[
classify
]
=
[
res
]
def
rebuild_bs_summary
(
self
,
bs_summary
,
unknown_summary
):
...
...
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