开始搞车牌的检测与识别,想边做便记录下来。

首先,我找的数据集是中科大的CCPD(Chinese City Parking Dataset)。

github

数据集对比(图片来源于作者论文)

CCPD layout (图片来源于作者论文)

之前找了好几个数据集,感觉这个数据集是最全最大的。下载位置都在GitHub仓库中作者有给链接。

它的标签就是图片名。

项目clone下来,就遇到了第一个错误:

原因是:pytorch的版本问题。

解决方案:

在roi_pooling.py 文件中第18行把 type(input) 修改为input.type() 就可以解决。

第二个错误:

又是pytorch版本问题,修改位置如下:

解决方案:

wR2.py文件213行的:lossAver.append(loss.data[0]) 修改为:lossAver.append(loss.item())

作者给的github的代码,跑出来的结果是没有打印车牌第一个汉字,如图:

这样就感觉不是特别好,于是想办法把它打印出来,解决方案是修改一下demo.py文件:

import cv2
from PIL import ImageFont, ImageDraw, Image #导入相关包
...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']
ads = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X','Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'O']
...
font = '/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf' #字体路径
font = ImageFont.truetype(fontpath, 32)   #设置字体
for i, (XI, ims) in enumerate(trainloader):if use_gpu:x = Variable(XI.cuda(0))else:x = Variable(XI)# Forward pass: Compute predicted y by passing x to the modelfps_pred, y_pred = model_conv(x)outputY = [el.data.cpu().numpy().tolist() for el in y_pred]labelPred = [t[0].index(max(t[0])) for t in outputY][cx, cy, w, h] = fps_pred.data.cpu().numpy()[0].tolist()img = cv2.imread(ims[0])left_up = [(cx - w/2)*img.shape[1], (cy - h/2)*img.shape[0]]right_down = [(cx + w/2)*img.shape[1], (cy + h/2)*img.shape[0]]cv2.rectangle(img, (int(left_up[0]), int(left_up[1])), (int(right_down[0]), int(right_down[1])), (0, 0, 255), 2)#lpn = alphabets[labelPred[1]] + ads[labelPred[2]] + ads[labelPred[3]] + ads[labelPred[4]] + ads[labelPred[5]] + ads[labelPred[6]]#lpn中加入省份的字符lpn = provinces[labelPred[0]] + alphabets[labelPred[1]] + ads[labelPred[2]] + ads[labelPred[3]] + ads[labelPred[4]] + ads[labelPred[5]] + ads[labelPred[6]]#cv2.putText(img, lpn, (int(left_up[0]), int(left_up[1])-20), cv2.FONT_ITALIC, 2, (0, 0, 255))#绘制文字信息draw.text((int(left_up[0]), int(left_up[1])-20),  lpn, font = font, fill = (0, 255, 0))cv2.imwrite(ims[0], img)

运行效果:

自己训练出来的效果图:

车牌检测与识别:License plate detection and recognition (LPDR)相关推荐

  1. 车牌识别--Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline

    Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline ECCV2018 ht ...

  2. 车牌识别1:License Plate Detection and Recognition in Unconstrained Scenarios阅读笔记

    转载好文一篇 一.WHAT 论文下载地址:License Plate Detection and Recognition in Unconstrained Scenarios [pdf] github ...

  3. License Plate Detection and Recognition in Unconstrained Scenarios

    论文:License Plate Detection and Recognition in Unconstrained Scenarios http://sergiomsilva.com/pubs/a ...

  4. 【读文献】License Plate Detection and Recognition in Unconstrained Scenarios(2018年ECCV)

    [读文献]License Plate Detection and Recognition in Unconstrained Scenarios(2018年ECCV) 参考文章链接:https://bl ...

  5. 深度学习 端对端的车牌检测与识别 LPDR算法 License Plate Detection and Recognition CCPD

    文章目录 链接 CCPD数据集 图片的标注 论文 使用 评价 ref 链接 github: https://github.com/xijunjun/CCPD 论文+模型 CCPD数据集 图片的标注 比 ...

  6. 车牌识别1.1:License Plate Detection and Recognition in Unconstrained Scenarios。

    代码位置 注意事项: 如果用python3运行的话 1.要把几个python文件中的print后面加括号. 2.license-plate-ocr.py文件中第45行 R,(width,height) ...

  7. 智能驾驶 车牌检测和识别(二)《YOLOv5实现车牌检测(含车牌检测数据集和训练代码)》

    智能驾驶 车牌检测和识别(二)<YOLOv5实现车牌检测(含车牌检测数据集和训练代码)> 目录 智能驾驶 车牌检测和识别(二)<YOLOv5实现车牌检测(含车牌检测数据集和训练代码) ...

  8. 车牌检测识别--Towards End-to-End Car License Plates Detection and Recognition with Deep Neural Networks

    Towards End-to-End Car License Plates Detection and Recognition with Deep Neural Networks https://ar ...

  9. 智能驾驶 车牌检测和识别(三)《CRNN和LPRNet实现车牌识别(含车牌识别数据集和训练代码)》

    智能驾驶 车牌检测和识别(三)<CRNN和LPRNet实现车牌识别(含车牌识别数据集和训练代码)> 目录 智能驾驶 车牌检测和识别(三)<CRNN和LPRNet实现车牌识别(含车牌识 ...

最新文章

  1. 漫画:原来,我是备胎!!!
  2. 使用WireShark简单分析ICMP报文
  3. 获取本机MSSQL保存凭证
  4. CTFshow 信息收集 web5
  5. serial driver 1
  6. Windows平台下Android源码的下载(Z)
  7. 复制一个文件夹中的所有文件和文件夹的java程序实现
  8. 八类网线和七类网线的区别_什么是七类网线?七类网线水晶头如何制作?
  9. Linux vi 双屏显示,manjaro AwesomeWM 上使用双显示器
  10. 英语基础语法(八)-时态
  11. Delaunay三角化实现原理
  12. yum是什么?(linux命令)
  13. Bailian4074 积水量【序列处理】
  14. 拓端tecdat|R语言代写岭回归ridge regression分析租房价格报告
  15. JAVA求n个数里最小的k个_n个数 找到最小的k个数 几种解法 和java实现
  16. uniapp 实现识别图片二维码
  17. 一文带你认识微内核,华为“鸿蒙”操作系统微内核到底是什么?
  18. 2021全球与中国光纤熔接机市场现状及未来发展趋势
  19. Thinkpad T420 安装 mSATA SSD 固态硬盘
  20. 统一vscode和hbuildX开发工具格式化规则

热门文章

  1. CCNP知识点总结——OSPF
  2. 微信小程序商城毕业设计毕设作品(3)后台功能
  3. 刚子扯扯蛋:说下百度对网站原创文章的个人感受
  4. GPS网络时间服务器(NTP时钟系统)技术应用方案
  5. 计算机作品大赛微课,我校微课作品获2018年中国大学生计算机设计大赛二等奖...
  6. 海伦公式和鞋带公式求三角形的面积
  7. the+比较级,the+比较级
  8. java如何让线程sheep_Java面试知识点之线程篇(三)
  9. 如何写好一篇SCI 并快速发表呢?
  10. 复旦计算机博士论文,2019年复旦大学历届全国优秀博士学位论文入选情况.doc