GithubHelp home page GithubHelp logo

jinxiaobo2017 / hyperlpr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from szad670401/hyperlpr

0.0 1.0 0.0 213.32 MB

基于深度学习高性能中文车牌识别 High Performance Chinese License Plate Recognition Framework.

Home Page: http://www.zeusee.com

License: Apache License 2.0

Python 27.51% CMake 28.07% Java 3.78% C++ 40.59% HTML 0.06%

hyperlpr's Introduction

High Accuracy Chinese License Plate Recognition Framework

介绍

This research aims at simply developping plate recognition project based on deep learning methods, with low complexity and high speed. This project has been used by some commercial corporations. Free and open source, deploying by Zeusee. this pipline also can apply to other countries license plate by training

HyperLPR是一个使用深度学习针对对中文车牌识别的实现,与其他开源的中文车牌识别框架相比,它的检测速度和鲁棒性和多场景的适应性都要好于其他的开源框架。

相关资源

更新

  • 增加了端到端模型的cpp实现,识别速度比分割快30%(Linux)(2018.1.31)
  • 增加字符分割训练代码和字符分割介绍(2018.1)
  • 更新了Android实现,大幅提高准确率和速度 (骁龙835 (720x1280) ~50ms )(2017.12.27)
  • 添加了IOS版本的实现(感谢xiaojun123456的工作)
  • 添加端到端的序列识别模型识别率大幅度提升,使得无需分割字符即可识别,识别速度提高20% (2017.11.17)
  • 新增的端到端模型可以识别新能源车牌、教练车牌、白色警用车牌、武警车牌 (2017.11.17)
  • 更新Windows版本的Visual Studio 2015 工程(2017.11.15)
  • 增加cpp版本,目前仅支持标准蓝牌(需要依赖OpenCV 3.3) (2017.10.28)

TODO

  • 提供字符字符识别的训练代码
  • 改进精定位方法
  • C++版的端到端识别模型

特性

  • 速度快 720p ,单核 Intel 2.2G CPU (macbook Pro 2015)平均识别时间低于100ms
  • 基于端到端的车牌识别无需进行字符分割
  • 识别率高,仅仅针对车牌ROI在EasyPR数据集上,0-error达到 95.2%, 1-error识别率达到 97.4% (指在定位成功后的车牌识别率)
  • 轻量 总代码量不超1k行

注意事项:

  • Win工程中若需要使用静态库,需单独编译
  • 本项目的C++实现和Python实现无任何关联,都为单独实现
  • 在编译C++工程的时候必须要使用OpenCV 3.3(DNN 库),否则无法编译

Python 依赖

  • Keras (>2.0.0)
  • Theano(>0.9) or Tensorflow(>1.1.x)
  • Numpy (>1.10)
  • Scipy (0.19.1)
  • OpenCV(>3.0)
  • Scikit-image (0.13.0)
  • PIL

CPP 依赖

  • Opencv 3.3

简单使用方式

from hyperlpr import  pipline as  pp
import cv2
image = cv2.imread("filename")
image,res  = pp.SimpleRecognizePlate(image)
print(res)

Linux/Mac 编译

  • 仅需要的依赖OpenCV 3.3 (需要DNN框架)
cd cpp_implementation
mkdir build 
cd build
cmake ../
sudo make -j 

CPP demo

#include "../include/Pipeline.h"
int main(){
    pr::PipelinePR prc("model/cascade.xml",
                      "model/HorizonalFinemapping.prototxt","model/HorizonalFinemapping.caffemodel",
                      "model/Segmentation.prototxt","model/Segmentation.caffemodel",
                      "model/CharacterRecognization.prototxt","model/CharacterRecognization.caffemodel",
                       "model/SegmentationFree.prototxt","model/SegmentationFree.caffemodel"
                    );
  //定义模型文件

    cv::Mat image = cv::imread("/Users/yujinke/ClionProjects/cpp_ocr_demo/test.png");
    std::vector<pr::PlateInfo> res = prc.RunPiplineAsImage(image,pr::SEGMENTATION_FREE_METHOD);
  //使用端到端模型模型进行识别 识别结果将会保存在res里面
 
    for(auto st:res) {
        if(st.confidence>0.75) {
            std::cout << st.getPlateName() << " " << st.confidence << std::endl;
          //输出识别结果 、识别置信度
            cv::Rect region = st.getPlateRect();
          //获取车牌位置
 cv::rectangle(image,cv::Point(region.x,region.y),cv::Point(region.x+region.width,region.y+region.height),cv::Scalar(255,255,0),2);
          //画出车牌位置
          
        }
    }

    cv::imshow("image",image);
    cv::waitKey(0);
    return 0 ;
}

可识别和待支持的车牌的类型

  • 单行蓝牌
  • 单行黄牌
  • 新能源车牌
  • 白色警用车牌
  • 使馆/港澳车牌
  • 教练车牌
  • 武警车牌
  • 民航车牌
  • 双层黄牌
  • 双层武警
  • 双层军牌
  • 双层农用车牌
  • 双层个性化车牌
Note:由于训练的时候样本存在一些不均衡的问题,一些特殊车牌存在一定识别率低下的问题,如(使馆/港澳车牌),会在后续的版本进行改进。

测试样例

image

image

Android示例

android

识别测试APP

数据分享

车牌识别框架开发时使用的数据并不是很多,有意着可以为我们提供相关车牌数据。联系邮箱 [email protected]

捐赠我们

如果您愿意支持我们持续对这个框架的开发,可以通过下面的链接来对我们捐赠。

支付宝/微信

获取帮助

  • HyperLPR讨论QQ群:673071218, 加前请备注HyperLPR交流。

hyperlpr's People

Contributors

szad670401 avatar brucexiaok avatar jsonshen avatar youngorsu avatar

Watchers

James Cloos 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.