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
725a8e62
authored
2021-04-13 12:46:42 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
b198d2cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
src/celery_compare/tasks.py
src/common/tools/comparison.py
src/celery_compare/tasks.py
View file @
725a8e6
...
...
@@ -67,16 +67,20 @@ def usedcar_info_compare(info_dict, ocr_res_dict, ocr_field, compare_list, res_s
break
for
idx
,
compare_tuple
in
enumerate
(
compare_list
):
input_str
=
info_dict
.
get
(
compare_tuple
[
0
])
ocr_str
=
ocr_res
.
get
(
compare_tuple
[
1
]
,
''
)
compare_res
=
getattr
(
cp
,
compare_tuple
[
2
])(
ocr_str
=
ocr_res
.
get
(
compare_tuple
[
1
])
compare_res
,
ocr_output
=
getattr
(
cp
,
compare_tuple
[
2
])(
info_dict
.
get
(
compare_tuple
[
0
]),
ocr_res
.
get
(
compare_tuple
[
1
]),
idx
,
**
compare_tuple
[
3
])
if
idx
==
0
and
compare_res
==
consts
.
RESULT_N
:
no_match_vino
.
append
(
ocr_str
)
if
ocr_str
is
not
None
:
no_match_vino
.
append
(
ocr_str
)
break
is_find
=
True
info_dict
[
compare_tuple
[
4
]]
=
compare_res
if
input_str
is
not
None
:
info_dict
[
compare_tuple
[
0
]]
=
ocr_str
if
ocr_str
is
None
or
ocr_output
is
None
:
del
info_dict
[
compare_tuple
[
0
]]
else
:
info_dict
[
compare_tuple
[
0
]]
=
ocr_output
res_set
.
add
(
compare_res
)
if
not
is_find
:
res_set
.
add
(
consts
.
RESULT_N
)
...
...
src/common/tools/comparison.py
View file @
725a8e6
...
...
@@ -82,9 +82,13 @@ class Comparison:
def
rmb_compare
(
self
,
input_str
,
ocr_str
,
idx
,
**
kwargs
):
if
not
isinstance
(
input_str
,
str
)
or
not
isinstance
(
ocr_str
,
str
):
return
self
.
RESULT_N
return
self
.
RESULT_N
,
None
input_rmb_upper
=
to_rmb_upper
(
float
(
input_str
))
return
self
.
build_res
(
input_rmb_upper
==
ocr_str
),
input_str
res
=
self
.
build_res
(
input_rmb_upper
==
ocr_str
)
if
res
==
self
.
RESULT_Y
:
return
res
,
input_str
else
:
return
res
,
None
def
type_compare
(
self
,
input_str
,
ocr_str
,
idx
,
**
kwargs
):
if
not
isinstance
(
input_str
,
str
)
or
not
isinstance
(
ocr_str
,
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