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
779b9a10
authored
2020-11-10 14:19:07 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix error msg
1 parent
55c99301
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
src/apps/doc/consts.py
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/consts.py
View file @
779b9a1
...
...
@@ -85,6 +85,7 @@ RES_SUCCESS_OTHER = '识别成功(其他类)'
RES_SUCCESS_EMPTY
=
'识别成功(空数据)'
RES_FAILED_1
=
'识别失败(阶段1)'
RES_FAILED_2
=
'识别失败(阶段2)'
RES_FAILED_3
=
'识别失败(阶段1数据格式错误)'
CARD_RATIO
=
0.9
UNKNOWN_CARD
=
'未知卡号'
...
...
src/apps/doc/management/commands/ocr_process.py
View file @
779b9a1
...
...
@@ -496,7 +496,7 @@ class Command(BaseCommand, LoggerMixin):
if
res
.
get
(
'code'
)
==
1
:
ocr_data_list
=
res
.
get
(
'data'
,
[])
if
not
isinstance
(
ocr_data_list
,
list
):
res_list
.
append
((
pno
,
ino
,
consts
.
RES_FAILED_
1
))
res_list
.
append
((
pno
,
ino
,
consts
.
RES_FAILED_
3
))
self
.
cronjob_log
.
info
(
'{0} [ocr_1 res error] [img={1}] [res={2}]'
.
format
(
self
.
log_base
,
img_path
,
res
))
else
:
...
...
@@ -504,7 +504,7 @@ class Command(BaseCommand, LoggerMixin):
ino_part
=
'{0}-{1}'
.
format
(
ino
,
part_idx
)
classify
=
ocr_data
.
get
(
'classify'
)
if
classify
is
None
:
res_list
.
append
((
pno
,
ino_part
,
consts
.
RES_FAILED_
1
))
res_list
.
append
((
pno
,
ino_part
,
consts
.
RES_FAILED_
3
))
self
.
cronjob_log
.
info
(
'{0} [ocr_1 res error] [img={1}] [res={2}]'
.
format
(
self
.
log_base
,
img_path
,
res
))
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