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
6847ba4b
authored
2021-05-17 22:54:17 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
1cfd8e70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/management/commands/ocr_process.py
View file @
6847ba4
...
...
@@ -299,7 +299,7 @@ class Command(BaseCommand, LoggerMixin):
if
do_dda
and
isinstance
(
id_card_dict
.
get
(
consts
.
IC_KEY_FIELD
[
0
]),
str
)
and
isinstance
(
id_card_dict
.
get
(
consts
.
IC_KEY_FIELD
[
1
]),
str
):
ic_name
=
id_card_dict
[
consts
.
IC_KEY_FIELD
[
0
]]
.
strip
()
ic_id
=
id_card_dict
[
consts
.
IC_KEY_FIELD
[
1
]]
.
strip
()
if
len
(
ic_name
)
>
0
and
ic_id
>
0
:
if
len
(
ic_name
)
>
0
and
len
(
ic_id
)
>
0
:
dda_id_bc_mapping
.
setdefault
(
consts
.
IC_FIELD
,
[])
.
append
((
ic_name
,
ic_id
,
img_path
))
license_summary
.
setdefault
(
classify
,
[])
.
extend
(
license_data
)
...
...
@@ -1137,9 +1137,8 @@ class Command(BaseCommand, LoggerMixin):
# id & bc 入库
try
:
if
not
dda_record
.
is_dda_found
:
if
not
dda_record
.
is_dda_found
and
not
dda_record
.
is_id_found
:
ic_set
=
set
()
bc_set
=
set
()
for
ic_name
,
ic_id
,
ic_img_path
in
ic_res_list
:
query_str
=
'{0}{1}'
.
format
(
ic_name
,
ic_id
)
if
query_str
in
ic_set
:
...
...
@@ -1152,6 +1151,8 @@ class Command(BaseCommand, LoggerMixin):
is_id
=
True
,
file_path
=
ic_img_path
)
if
not
dda_record
.
is_dda_found
and
not
dda_record
.
is_bc_found
:
bc_set
=
set
()
for
bc_no
,
bc_img_path
in
bc_res_list
:
if
bc_no
in
bc_set
:
continue
...
...
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