# plate_detector **Repository Path**: sunqiangAAA/plate_detector ## Basic Information - **Project Name**: plate_detector - **Description**: 车牌检测+车牌校正+车牌文字颜色识别 - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: https://gitee.com/sunqiangAAA - **GVP Project**: No ## Statistics - **Stars**: 10 - **Forks**: 6 - **Created**: 2024-01-15 - **Last Updated**: 2025-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: 车牌检测, 车牌校正, 车牌识别, Cpp, onnx ## README # PlateDetection-onnxruntime-C++ 车牌检测+车牌校正+车牌识别(文字和颜色)(有问题可以联系:18844182902@163.com(微信:SQ1341440495)) ## 支持: - 1.单行蓝牌 - 2.单行黄牌 - 3.新能源车牌 - 4.白色警用车牌 - 5.教练车牌 - 6.武警车牌 - 7.双层黄牌 - 8.双层白牌 - 9.使馆车牌 - 10.港澳粤Z牌 - 11.双层绿牌 - 12.民航车牌 ## 依赖: - OpenCV 4.x - ONNXRuntime 1.7+ - OS: Tested on Windows 10 and Ubuntu 20.04 - CUDA 11+ [Optional] ## 一、自己构建(不推荐) ### 构建 1、查看电脑对应版本的onnxruntime版本,查看地址:https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements 2、下载自己电脑对应版本的ONNXRUNTIME(下载GPU版本需要cuda和cudnn对应,详见步骤1),下载地址:https://github.com/microsoft/onnxruntime/releases 3、下载后解压,将include和lib文件覆盖项目中对应文件。 ```bash mkdir build cd build cmake .. cmake --build . ``` ### 运行 ```shell # 获取帮助 yolo_ort -h ``` ```shell # 使用命令行参数指定模型路径(models)和图像路径(images) ./yolo_ort --model_path "" --plate_path "" --image "" --class_names "" --gpu ``` - 使用CPU: ```shell # 使用命令行参数指定模型路径(models)和图像路径(images) ./yolo_ort --model_path "" --plate_path "" --image "" --class_names "" ``` ## 二、Docker构建(推荐) 步骤1:从Docker Hub拉取镜像 ```dockerfile docker pull sunqiang188/plate_detector:latest ``` 步骤2:运行Docker ```dockerfile docker run -dt --name plate_detect --restart=always -m 8000M --gpus all --memory-swap -1 plate_detector:latest ``` 步骤3:进入Docker的Shell ``` docker exec -it plate_detect /bin/bash ``` 步骤4:执行命令 ```shell cd ./plate_detector mkdir build && cd ./build cmake .. make ``` 步骤5:运行 ``` # 获取帮助 ./yolo_ort -h # --model_path 车牌检测模型 --plate_path 车牌识别模型 --image 图片路径 --class_names 类别名称 --gpu 开启GPU推理 ./yolo_ort --model_path "" --plate_path "" --image "" --class_names "" ``` ## 参考 - YOLO v5 repo: https://github.com/ultralytics/yolov5 - YOLOv5 Runtime Stack repo: https://github.com/zhiqwang/yolov5-rt-stack - ONNXRuntime Inference examples: https://github.com/itsnine/yolov5-onnxruntime - 车牌检测训练:https://github.com/we0091234/Chinese_license_plate_detection_recognition - 车牌识别训练:https://github.com/we0091234/crnn_plate_recognition