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
8a3a0bab
authored
2021-04-13 17:16:01 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
ef85abbe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
src/apps/doc/consts.py
src/common/tools/comparison.py
src/apps/doc/consts.py
View file @
8a3a0ba
...
...
@@ -1091,8 +1091,8 @@ ID_TYPE_COMPARE = {
# 车辆登记证
PCUSD_MVC
=
[
(
'vinNo'
,
'9.车辆识别代号/车架号'
,
'common_compare'
,
{},
'vinNoResult'
),
(
'manufactureDate'
,
'32.车辆出厂日期'
,
'
common
_compare'
,
{},
'manufactureDateResult'
),
(
'firstRegistrationDate'
,
'3.登记日期'
,
'
common
_compare'
,
{},
'firstRegistrationDateResult'
),
(
'manufactureDate'
,
'32.车辆出厂日期'
,
'
date
_compare'
,
{},
'manufactureDateResult'
),
(
'firstRegistrationDate'
,
'3.登记日期'
,
'
date
_compare'
,
{},
'firstRegistrationDateResult'
),
]
# 行驶证
...
...
src/common/tools/comparison.py
View file @
8a3a0ba
...
...
@@ -77,14 +77,21 @@ class Comparison:
except
Exception
as
e
:
ocr_output
=
None
else
:
ocr_output
=
ocr_str
try
:
ocr_output
=
datetime
.
strptime
(
ocr_str
,
'
%
Y-
%
m-
%
d'
)
.
strftime
(
'
%
Y-
%
m-
%
d'
)
except
Exception
as
e
:
ocr_output
=
None
return
self
.
build_res
(
input_str
==
ocr_str
),
ocr_output
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
,
None
try
:
input_rmb_upper
=
to_rmb_upper
(
float
(
input_str
))
res
=
self
.
build_res
(
input_rmb_upper
==
ocr_str
)
except
Exception
as
e
:
return
self
.
RESULT_N
,
None
else
:
if
res
==
self
.
RESULT_Y
:
return
res
,
input_str
else
:
...
...
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