Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
my_flask_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d056a408
authored
Jan 17, 2024
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码逻辑
1 parent
7bcabaa1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
Identify_vinandsn/main04.py
test01.py
Identify_vinandsn/main04.py
View file @
d056a40
...
@@ -75,7 +75,7 @@ ocr = PaddleOCR(
...
@@ -75,7 +75,7 @@ ocr = PaddleOCR(
# 定义要执行的SQL语句
# 定义要执行的SQL语句
SQL
=
"""
SQL
=
"""
select * from sys_order_file_ocr sofo
select * from sys_order_file_ocr sofo
limit 1000
"""
"""
# 执行SQL语句
# 执行SQL语句
cursor_dev
.
execute
(
SQL
)
cursor_dev
.
execute
(
SQL
)
...
@@ -186,12 +186,17 @@ for index, row in enumerate(result):
...
@@ -186,12 +186,17 @@ for index, row in enumerate(result):
result_list
=
flatten_list
(
result
)
result_list
=
flatten_list
(
result
)
print
(
"result_list"
,
result_list
)
print
(
"result_list"
,
result_list
)
with
open
(
"./log07.txt"
,
"a+"
,
encoding
=
"utf-8"
)
as
file
:
if
result_list
is
not
None
:
file
.
write
(
path
+
"----"
+
str
(
result_list
)
+
"
\n
"
)
else
:
file
.
write
(
path
+
"----"
+
"NULL"
+
"
\n
"
)
# 使用正则表达式进行过滤 获取车架号
# 使用正则表达式进行过滤 获取车架号
vin_str
=
""
vin_str
=
""
for
item
in
result_list
:
for
item
in
result_list
:
print
(
item
)
print
(
item
)
vin_check
=
validate
_vin
(
item
)
vin_check
=
extract
_vin
(
item
)
if
vin_check
is
not
None
:
if
vin_check
is
not
None
:
vin_str
=
vin_check
vin_str
=
vin_check
break
break
...
...
test01.py
View file @
d056a40
...
@@ -12,6 +12,6 @@ def extract_vin(string):
...
@@ -12,6 +12,6 @@ def extract_vin(string):
# 测试字符串
# 测试字符串
test_string
=
"This is a test VIN: 1HGCM82633A123456"
test_string
=
"This is a test VIN: 1HGCM82633A123456
GT800
"
result
=
extract_vin
(
test_string
)
result
=
extract_vin
(
test_string
)
print
(
result
)
# 输出 1HGCM82633A123456
print
(
result
)
# 输出 1HGCM82633A123456
Write
Preview
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