Code Monkey home page Code Monkey logo

yolov7_plate's Introduction

yolov7车牌识别算法,支持12种中文车牌类型

1.单行蓝牌 2.单行黄牌 3.新能源车牌 4.白色警用车牌 5 教练车牌 6 武警车牌 7 双层黄牌 8 双层武警 9 使馆车牌 10 港澳牌车 11 双层农用车牌 12 民航车牌

测试demo: 以yolov7-lite-s 为例:

python detect_rec_plate.py --detect_model weights/yolov7-lite-s.pt  --rec_model weights/plate_rec.pth --source imgs --output result

测试文件夹imgs,结果保存再 result 文件夹中

车牌检测训练

  1. 下载数据集: 联系本人获取 联系方式最下面 数据从CCPD和CRPD数据集中选取并转换的 数据集格式为yolo格式:

    label x y w h  pt1x pt1y pt2x pt2y pt3x pt3y pt4x pt4y
    

    关键点依次是(左上,右上,右下,左下) 坐标都是经过归一化,x,y是中心点除以图片宽高,w,h是框的宽高除以图片宽高,ptx,pty是关键点坐标除以宽高

  2. 修改 data/plate.yaml train和val路径,换成你的数据路径

    train: /your/train/path #修改成你的路径
    val: /your/val/path     #修改成你的路径
    # number of classes
    nc: 2                 #这里用的是2分类,0 单层车牌 1 双层车牌
    
    # class names
    names: [ 'single','double']
    
    
  3. 训练 以yolov7-lite-s 为例:

    python train.py  --batch-size 32 --data data/plate.yaml --img 640 640 --cfg cfg/yolov7-lite-s.yaml --weights weights/yolov7-lite-s.pt --name yolov7 --hyp data/hyp.face.yaml
    

    结果存在run文件夹中

车牌识别训练

车牌识别训练链接如下:

车牌识别训练

支持如下:

Image

部署

References

有问题添加微信: we0091234,拉进微信群

或者加qq群:823419837(已满) 请加 837982567(二群) 询问

Image

yolov7_plate's People

Contributors

we0091234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yolov7_plate's Issues

黑色和蓝色分不清

有95%的概率将蓝色识别为黑色,白天的情况下,用视频和图片都会出现这个情况

IndexError: index 13 is out of bounds for axis 0 with size 4

hello! 为什莫会出现这样的错误?我的是3分类,为什莫index会出现13。
Traceback (most recent call last):
File "test.py", line 397, in
test(opt.data,
File "test.py", line 236, in test
confusion_matrix.process_batch(predn, torch.cat((labels[:, 0:1], tbox), 1))
File "/root/yolo/yolov7_plate/utils/metrics.py", line 148, in process_batch
self.matrix[detection_classes[m1[j]], gc] += 1 # correct
IndexError: index 13 is out of bounds for axis 0 with size 4

export onnx模型时 选择 exportnms后出现了这个错误 NYI:Named tensors are not supported with the tracer, 可能是在调用models/export.py 的第80行导致的,nn.Squential不支持命名向量,请问目前有什么好的解决办法吗?

export onnx模型时出现了这个错误 NYI:Named tensors are not supported with the tracer, 可能是在调用models/export.py 的第80行导致的,nn.Squential不支持命名向量,请问目前有什么好的解决办法吗?

Originally posted by @miracletrespasser in #1 (comment)

yolov7导出onnx模型

感谢作者提供的车牌检测的代码,请问作者能不能分享一下用yolv7实现的车牌检测转成onnx模型,我尝试着使用您在yolov5实现车牌检测中,将权重转成onnx,但在进行onnxruntime推理时,出现以下索引错误,发生异常: IndexError
index 4 is out of bounds for axis 1 with size 3

动态batch推理

你好,博主,很感谢你的项目代码,目前在用这个代码的时候遇到一点问题,我在导出onnx的时候,设置了动态batch,基于yolov5和yolov7的版本,都做了尝试,发现报了同样的错误,在多张图片同时进行推理的时候
Reshape node. Name:'/model.1/Reshape' Status Message: D:\a_work\1\s\onnxruntime\core\providers\cpu\tensor\reshape_helper.h:41 onnxruntime::ReshapeHelper::ReshapeHelper gsl::narrow_cast<int64_t>(input_shape.Size()) == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{2,96,80,80}, requested shape:{1,2,48,80,80}
看着像是在某个节点reshape的时候报错了,yolov5和v7都是在同样的节点,想问下博主这种情况怎么解决?还是我操作的有问题?

部署的时候会考虑量化模型么?

首先感谢大佬无私的开源, 整套工具都很全, 从训练到部署, 支持的也比较全, 但是我看没有做8bits量化,大佬请问是有尝试过么, 做量化会损失精度么?

labelling

嗨,很抱歉我问这个问题,我不是来自**,但我对你为我的大学研究所做的工作很感兴趣。 您使用什么工具来标记图像? labelimg 似乎没有提供标记 4 个关键点的方法。 对不起中文不好,我用谷歌翻译

有关nnie部署的问题

请问有尝试过yolov_plate部署在NNIE平台的芯片上吗?我在使用onnx转caffe的时候会出现这个问题?能不能帮忙看下
image

模型onnx导出问题

非常感谢大佬杰出的工作!!!我在用export.py导出onnx模型的时候,想把cat部分去掉,也看到了这一部分的开关:
image
但是这个开关只对yolov7-lite-s.pt模型有效,对yolov7-lite-t.pt模型是无效的,想请教大佬怎样才能把yolov7-lite-t.pt顺利导出呢。

结果绘制问题

非常感谢您的代码,在训练后看结果,突然发现验证集的loss一直在增长,但是看result数据后3列是正常的,发现result中存在如下的结果:
0/299 2.58G 0.04211 0.003418 0.0004832 0.006365 0.0006483 0.05303 551 320 0.9413 0.961 0.976 0.7626 0.02045 0.001281 0.0002736
理解依次是训练周期,占用大小,训练集回归loss,置信度loss,clsloss,然后4个不太清楚意思(应该有total,target,另外两个是什么呢?),图片大小,最后是P,R,map0.5,map0.5-0.95,验证集的回归,置信度,clsloss,这样数字比之前设定的多,和画图那边的[2, 3, 4, 8, 9, 12, 13, 14, 10, 11]不匹配。

tensorrt 推理编译错误 CMakeFiles/onnx2trt.dir/onnx2trt.cpp.o: In function `cvflann::anyimpl::big_any_policy<cv::String>::static_delete(void**)': onnx2trt.cpp:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv]+0x15): undefined reference to `cv::String::deallocate()'

如何错误,我换了4.5.2 和 3.2都不行,查了一下opencv 3.1.0-dev才有`cvflann::anyimpl::big_any_policycv::String这个函数

请问你编译的opencv版本是多少

一个想法

设计一个车牌检测网络,同时设计出具有分类和回归的能力。回归能力已经具备了!

是否可以设计出具有多分类的能力?

比如对车牌单双层分类,对车牌颜色分类,对车牌属于车头车尾分类?而不是在检测时枚举出所有可能的类别,单层_蓝牌_车头_车牌、双层_黄牌_车尾_车牌等等

training

Sorry if i asked so much, but i experienced this error and i cant see anyone solve this in internet. thank you
image

i used pytorch 1.13.1, cuda 11.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.