HyperLPR车牌识别项目踩坑记录

环境
win10、anaconda4.8.3 、python3.8

github地址:
https://github.com/zeusees/HyperLPR

填坑参考网址:https://www.cnblogs.com/zhupengfei/p/12104504.html

配置参考网址:
https://www.jianshu.com/p/7ab673abeaae

由于最近需要做个校园超速车牌检测的项目,有部分需要用到它,但这个项目很多包的版本比较低,高版本不兼容。

下载完后解压目录是这个样子:
在这里插入图片描述
实际上只需要 hyperlpr_py3 、Font 、model 三个文件夹。单独拿出来建个文件夹,再建个car,把测试图片放里面。

  1. cmd后创建一个新环境 conda create -n hyperlpr36 python=3.6,然后查看自己的环境 conda info -e
    在这里插入图片描述
    (删除某个环境是 conda remove -n hyperlpr --all

  2. 然后激活它 activate hyperlpr36,使用 conda list 查看里面安装的包。
    在这里插入图片描述

  3. 安装需要的包,也可以选择其他的源

pip install keras==2.0.9 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install Theano==1.0.4 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install numpy==1.16.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install Scipy==1.4.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install opencv-python==3.4.3.18 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install scikit-image==0.17.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install pillow==7.1.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install tensorflow==1.2.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

pip install h5py==2.10.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

这是我的版本:

(hyperlpr36) C:\Users\hll>conda list
# packages in environment at D:\Program Files\Anaconda3\envs\hyperlpr36:
#
# Name                    Version                   Build  Channel
backcall                  0.1.0                    py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
backports-weakref         1.0rc1                   pypi_0    pypi
bleach                    1.5.0                    pypi_0    pypi
certifi                   2020.4.5.1               py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
colorama                  0.4.3                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
cycler                    0.10.0                   pypi_0    pypi
decorator                 4.4.2                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
entrypoints               0.3                      py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
h5py                      2.10.0                   pypi_0    pypi
html5lib                  0.9999999                pypi_0    pypi
imageio                   2.8.0                    pypi_0    pypi
ipykernel                 5.1.4            py36h39e3cac_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
ipython                   7.13.0           py36h5ca1d4c_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
ipython_genutils          0.2.0                    py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
jedi                      0.17.0                   py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
jupyter_client            6.1.3                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
jupyter_core              4.6.3                    py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
keras                     2.0.9                    pypi_0    pypi
kiwisolver                1.2.0                    pypi_0    pypi
libsodium                 1.0.16               h9d3ae62_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
markdown                  2.2.0                    pypi_0    pypi
matplotlib                3.2.1                    pypi_0    pypi
networkx                  2.4                      pypi_0    pypi
numpy                     1.16.0                   pypi_0    pypi
opencv-python             3.4.3.18                 pypi_0    pypi
parso                     0.7.0                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pickleshare               0.7.5                    py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pillow                    7.1.2                    pypi_0    pypi
pip                       20.0.2                   py36_3    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
prompt-toolkit            3.0.5                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
prompt_toolkit            3.0.5                         0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
protobuf                  3.12.2                   pypi_0    pypi
pygments                  2.6.1                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pyparsing                 2.4.7                    pypi_0    pypi
python                    3.6.10               h9f7ef89_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
python-dateutil           2.8.1                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pywavelets                1.1.1                    pypi_0    pypi
pywin32                   227              py36he774522_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
pyyaml                    5.3.1                    pypi_0    pypi
pyzmq                     18.1.1           py36ha925a31_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
scikit-image              0.17.2                   pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
setuptools                46.4.0                   py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
six                       1.15.0                   pypi_0    pypi
sqlite                    3.31.1               h2a8f88b_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
tensorflow                1.2.0                    pypi_0    pypi
theano                    1.0.4                    pypi_0    pypi
tifffile                  2020.5.30                pypi_0    pypi
tornado                   6.0.4            py36he774522_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
traitlets                 4.3.3                    py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
vc                        14.1                 h0510ff6_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
vs2015_runtime            14.16.27012          hf0eaf9b_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
wcwidth                   0.1.9                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
wincertstore              0.2              py36h7fe50ca_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
zeromq                    4.3.1                h33f27b4_3    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
zlib                      1.2.11               h62dcd97_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  1. hyperlpr_py3复制到你的目录\Anaconda3\envs\hyperlpr36\Lib下,并改名为hyperlpr

  2. 可以在 pycharm 测试,也可以用 jupyter notebook 测试。

pycharm中

新建一个test.py,记得编译器必须选刚刚建的虚拟环境

from hyperlpr import pipline as  pp
import cv2
# 自行修改文件名
image = cv2.imread("./car/3.jpg")
image,res  = pp.SimpleRecognizePlate(image)
print(res)

jupyter notebook中

  • 在hyperlpr36环境下进入jupyter notebook

  • 找到你的源目录,new一个python3的test文件,代码一样

  • 点击kernel中的change kernel,选择你的虚拟环境

    这里也许只有python 3选项,因为还没导入虚拟环境。步骤如下:

    1.在cmd中激活hyperlpr36环境

    2.在hyperlpr36环境中中安装好ipykernel

    conda install ipykernel
    

    3.在你的C:\ProgramData\jupyter\kernels路径下生成hyperlpr36文件

    python -m ipykernel install --name adda
    

    现在重新打开jupyter notebook,里面就会显示有这个虚拟环境了

测试结果:

原图:
在这里插入图片描述
结果:
在这里插入图片描述

正的视角准确率还不错,但是在中文字符的识别上准确率不高,有些图片测试不起,我的是cascade.xml这个粗定位模型根本没找到图片中车牌的位置,所以准备自己训练下这个模型。

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值