Giter Site home page Giter Site logo

wxg0101 / chinese_license_plate_detection_recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from we0091234/chinese_license_plate_detection_recognition

0.0 0.0 0.0 92.25 MB

yolov5 车牌检测 车牌识别 中文车牌识别 检测 支持12种中文车牌 支持双层车牌

License: GNU General Public License v3.0

Shell 2.34% Python 97.05% Cython 0.42% Dockerfile 0.20%

chinese_license_plate_detection_recognition's Introduction

What's New

2022.12.04 车辆和车牌一起检测看这里车辆系统

yolov7 车牌检测+识别

最全车牌识别算法,支持14种中文车牌类型

环境要求: python >=3.6 pytorch >=1.7

图片测试demo:

python detect_plate.py --detect_model weights/plate_detect.pt  --rec_model weights/plate_rec.pth --image_path imgs --output result

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

视频测试demo 2.MP4 提取码:41aq

python detect_plate.py --detect_model weights/plate_detect.pt  --rec_model weights/plate_rec.pth --video 2.mp4

视频文件为2.mp4 保存为result.mp4

车牌检测训练

  1. 下载数据集: datasets 提取码:pi6c 数据从CCPD和CRPD数据集中选取并转换的 数据集格式为yolo格式:

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

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

  2. 修改 data/widerface.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. 训练

    python3 train.py --data data/widerface.yaml --cfg models/yolov5n-0.5.yaml --weights weights/plate_detect.pt --epoch 250
    

    结果存在run文件夹中

  4. 检测模型 onnx export 检测模型导出onnx,需要安装onnx-sim onnx-simplifier

    1. python export.py --weights ./weights/plate_detect.pt --img 640 --batch 1
    2. onnxsim weights/plate_detect.onnx weights/plate_detect.onnx
    

    训练好的模型进行检测

    python detect_demo.py  --detect_model weights/plate_detect.pt
    

车牌识别训练

车牌识别训练链接如下:

车牌识别训练

支持如下:

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

Image

部署

  1. 安卓NCNN

2.onnx demo,onnx模型见onnx模型,提取码:ixyr

python onnx_infer.py --detect_model weights/plate_detect.onnx  --rec_model weights/plate_rec.onnx  --image_path imgs --output result_onnx

3.tensorrt 部署见tensorrt_plate

4.openvino demo 版本2022.2

 python openvino_infer.py --detect_model weights/plate_detect.onnx --rec_model weights/plate_rec.onnx --image_path imgs --output result_openvino

References

联系

有问题可以提issues 或者加qq群:871797331 询问

chinese_license_plate_detection_recognition's People

Contributors

we0091234 avatar

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.