Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
LPRNet_pytorch
Commits
e5f3f3ee
Commit
e5f3f3ee
authored
Mar 03, 2023
by
刘明贵
Browse files
修改readme
parent
9d5a70ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
README.md
README.md
+4
-1
cut_ccpd.py
cut_ccpd.py
+13
-3
No files found.
README.md
View file @
e5f3f3ee
...
@@ -13,7 +13,10 @@ LPR是一个基于深度学习技术的车牌识别模型,主要识别目标
...
@@ -13,7 +13,10 @@ LPR是一个基于深度学习技术的车牌识别模型,主要识别目标
## 数据集
## 数据集
推荐使用一个车牌数据集
[
CCPD
](
https://github.com/detectRecog/CCPD
"CCPD官网GitHub"
)
,该数据集由中科大收集,可用于车牌的检测与识别。
推荐使用一个车牌数据集
[
CCPD
](
https://github.com/detectRecog/CCPD
"CCPD官网GitHub"
)
,该数据集由中科大收集,可用于车牌的检测与识别。
我们提供了一个脚本cut_ccpd.py用于剪裁出CCPD数据集中的车牌位置,以便用于LPR模型的训练,在cut_ccpd.py中修改img_path和save_path即可,分别是CCPD数据集中ccpd_base文件夹的路径和剪裁出的图像保存路径。LPR用于训练的数据文件名就是图像的标签。
**数据集使用固定的大小94x24。**
我们提供了一个脚本cut_ccpd.py用于剪裁出CCPD数据集中的车牌位置,以便用于LPR模型的训练,在cut_ccpd.py中修改img_path和save_path即可,分别是CCPD数据集中ccpd_base文件夹的路径和剪裁出的图像保存路径。LPR用于训练的数据文件名就是图像的标签。
**数据集使用固定的大小94x24。**
使用方法:
python cut_ccpd.py
\
--ccpdpath CCPD数据集下ccpd_base文件夹路径
\
--savepath 保存切割图像的路径
## 训练及推理
## 训练及推理
### 环境配置
### 环境配置
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取docker镜像,在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
可下载Migraphx和ONNXruntime安装包。LPR推荐的镜像、Migraphx以及ONNXruntime版本如下:
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取docker镜像,在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
可下载Migraphx和ONNXruntime安装包。LPR推荐的镜像、Migraphx以及ONNXruntime版本如下:
...
...
cut_ccpd.py
View file @
e5f3f3ee
'''
Author: liuhy
email: liuhy6@sugon.com
Date: 2023-03-03 10:17:07
LastEditTime: 2023-03-03 11:28:33
FilePath: \lpr\cut_ccpd.py
'''
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# @Author: liuhy
# @Author: liuhy
# @Email: 17603873430@163.com
# @Email: 17603873430@163.com
...
@@ -7,6 +14,7 @@
...
@@ -7,6 +14,7 @@
import
os
import
os
import
cv2
import
cv2
import
time
import
time
import
argparse
provinces
=
[
'皖'
,
'沪'
,
'津'
,
'渝'
,
'冀'
,
'晋'
,
'蒙'
,
'辽'
,
'吉'
,
'黑'
,
'苏'
,
'浙'
,
'京'
,
'闽'
,
'赣'
,
'鲁'
,
'豫'
,
'鄂'
,
'湘'
,
'粤'
,
'桂'
,
'琼'
,
'川'
,
'贵'
,
'云'
,
'藏'
,
'陕'
,
'甘'
,
'青'
,
'宁'
,
'新'
,
'警'
,
'学'
,
'O'
]
provinces
=
[
'皖'
,
'沪'
,
'津'
,
'渝'
,
'冀'
,
'晋'
,
'蒙'
,
'辽'
,
'吉'
,
'黑'
,
'苏'
,
'浙'
,
'京'
,
'闽'
,
'赣'
,
'鲁'
,
'豫'
,
'鄂'
,
'湘'
,
'粤'
,
'桂'
,
'琼'
,
'川'
,
'贵'
,
'云'
,
'藏'
,
'陕'
,
'甘'
,
'青'
,
'宁'
,
'新'
,
'警'
,
'学'
,
'O'
]
alphabets
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'P'
,
'Q'
,
'R'
,
'S'
,
'T'
,
'U'
,
'V'
,
'W'
,
'X'
,
'Y'
,
'Z'
,
'O'
]
alphabets
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'P'
,
'Q'
,
'R'
,
'S'
,
'T'
,
'U'
,
'V'
,
'W'
,
'X'
,
'Y'
,
'Z'
,
'O'
]
...
@@ -45,7 +53,9 @@ def cut_img(img_path, save_path):
...
@@ -45,7 +53,9 @@ def cut_img(img_path, save_path):
print
(
'wrong image:'
,
image
)
print
(
'wrong image:'
,
image
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
img_path
=
'CCPD/ccpd_base'
parser
=
argparse
.
ArgumentParser
(
description
=
'parameters to vaildate net'
)
save_path
=
'CCPD/lp_base'
parser
.
add_argument
(
'--ccpdpath'
,
default
=
'CCPD/ccpd_base'
,
help
=
'model path to vaildate'
)
cut_img
(
img_path
,
save_path
)
parser
.
add_argument
(
'--savepath'
,
default
=
'CCPD/lpr'
,
help
=
'the image path'
)
args
=
parser
.
parse_args
()
cut_img
(
args
.
ccpdpath
,
args
.
savepath
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment