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
7967d700
authored
2021-04-15 15:32:55 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
one card
1 parent
fae49be8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/celery_compare/tasks.py
View file @
7967d70
...
...
@@ -29,6 +29,7 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set, has
ocr_res_str
=
ocr_res_dict
.
get
(
ocr_field
)
if
ocr_res_str
is
not
None
:
ocr_res_list
=
json
.
loads
(
ocr_res_str
)
length
=
len
(
ocr_res_list
)
# 过期期限特殊处理
if
has_expiry_date
:
...
...
@@ -49,7 +50,7 @@ def field_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_set, has
compare_res
,
ocr_output
=
getattr
(
cp
,
compare_tuple
[
2
])(
input_str
,
ocr_str
,
idx
,
**
compare_tuple
[
3
])
print
(
'type: {0}, idx: {1}, field: {2}, input: {3}, ocr: {4}, res: {5}, out: {6}'
.
format
(
ocr_field
,
idx
,
compare_tuple
[
0
],
input_str
,
ocr_str
,
compare_res
,
ocr_output
))
if
idx
==
0
and
compare_res
in
[
consts
.
RESULT_N
,
consts
.
RESULT_NA
]:
if
idx
==
0
and
compare_res
in
[
consts
.
RESULT_N
,
consts
.
RESULT_NA
]
and
length
>
1
:
break
is_find
=
True
...
...
@@ -87,6 +88,8 @@ def usedcar_info_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_s
ocr_res_str
=
ocr_res_dict
.
get
(
ocr_field
)
if
ocr_res_str
is
not
None
:
ocr_res_list
=
json
.
loads
(
ocr_res_str
)
length
=
len
(
ocr_res_list
)
for
ocr_res
in
ocr_res_list
:
if
is_find
:
break
...
...
@@ -99,6 +102,7 @@ def usedcar_info_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_s
if
idx
==
0
and
compare_res
in
[
consts
.
RESULT_N
,
consts
.
RESULT_NA
]:
if
ocr_str
is
not
None
:
no_match_vino
.
append
(
ocr_str
)
if
length
>
1
:
break
is_find
=
True
info_dict
[
compare_tuple
[
4
]]
=
compare_res
...
...
src/common/tools/comparison.py
View file @
7967d70
...
...
@@ -102,10 +102,7 @@ class Comparison:
if
not
isinstance
(
input_str
,
str
)
or
not
isinstance
(
ocr_str
,
str
):
return
self
.
RESULT_NA
,
None
if
ocr_str
==
''
:
if
input_str
==
'0.0'
:
return
self
.
RESULT_Y
,
input_str
else
:
return
self
.
RESULT_N
,
'0.0'
return
self
.
RESULT_NA
,
None
try
:
input_rmb_upper
=
to_rmb_upper
(
float
(
input_str
))
res
=
self
.
build_res
(
input_rmb_upper
==
ocr_str
)
...
...
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