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
d3de42e6
authored
2021-11-18 14:19:43 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix HIL contract
1 parent
a7933381
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
src/common/electronic_hil_contract/get_char.py
src/common/electronic_hil_contract/hil_contract_ocr.py
src/common/electronic_hil_contract/get_char.py
View file @
d3de42e
This diff is collapsed.
Click to expand it.
src/common/electronic_hil_contract/hil_contract_ocr.py
View file @
d3de42e
...
...
@@ -18,7 +18,6 @@ def predict(pdf_info, file_cls):
Returns:
TYPE: Description
"""
# 0: 售后回租合同
pdf_info_0
=
[]
for
pno
in
pdf_info
:
...
...
@@ -30,7 +29,6 @@ def predict(pdf_info, file_cls):
bbox
,
text
=
span
[
'bbox'
],
span
[
'text'
]
if
'售后回租合同_'
in
text
:
pdf_info_0
.
append
(
pdf_info
[
pno
])
# 1: 车辆处置协议
pdf_info_1
=
[]
for
pno
in
pdf_info
:
...
...
@@ -42,7 +40,6 @@ def predict(pdf_info, file_cls):
bbox
,
text
=
span
[
'bbox'
],
span
[
'text'
]
if
'售后回租合同附件一'
in
text
:
pdf_info_1
.
append
(
pdf_info
[
pno
])
# 2: 车辆租赁抵押合同
pdf_info_2
=
[]
for
pno
in
pdf_info
:
...
...
@@ -54,7 +51,6 @@ def predict(pdf_info, file_cls):
bbox
,
text
=
span
[
'bbox'
],
span
[
'text'
]
if
'车辆租赁抵押合同_'
in
text
:
pdf_info_2
.
append
(
pdf_info
[
pno
])
is_clczxy
=
False
# 如果 pdf_info_1 == 4 页,则说明此时输入包含了车辆处置协议
if
len
(
pdf_info_1
)
==
4
and
file_cls
==
1
and
len
(
pdf_info_0
)
!=
0
:
...
...
@@ -62,7 +58,6 @@ def predict(pdf_info, file_cls):
pdf_info
=
dict
()
for
pno
,
page_info
in
enumerate
(
pdf_info_1
):
pdf_info
[
str
(
pno
)]
=
page_info
f
=
Finder
(
pdf_info
)
if
file_cls
==
0
:
results
=
f
.
get_info
()
...
...
@@ -72,13 +67,11 @@ def predict(pdf_info, file_cls):
if
file_cls
==
2
:
# 提取信息 ———— 车辆租赁抵押合同
results
=
f
.
get_info_2
()
if
is_clczxy
==
True
:
if
is_clczxy
is
True
:
for
key
in
results
:
if
results
[
key
][
'page'
]
is
not
None
:
results
[
key
][
'page'
]
=
str
(
int
(
results
[
key
][
'page'
])
+
6
)
results
[
key
][
'page'
]
=
str
(
int
(
results
[
key
][
'page'
])
+
6
)
for
key
in
results
:
if
results
[
key
][
'page'
]
is
not
None
:
results
[
key
][
'page'
]
=
'page_'
+
str
(
int
(
results
[
key
][
'page'
])
+
1
)
results
[
key
][
'page'
]
=
'page_'
+
str
(
int
(
results
[
key
][
'page'
])
+
1
)
return
results
...
...
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