Giter Club home page Giter Club logo

easypr-python's Introduction

ULPR (Universal License Plate Recognition)

ULPR(Universal License Plate Recognition)的设想是一个通用场景下的车牌识别系统。因为是从EasyPR出发,所以还是保留EasyPR-python的原库名。

  1. 用python写了一下EasyPR,但其中应该还是有bug,速度慢是detect部分很慢,有python本身的锅,也有我没有优化的锅
  2. 用deep的方法做检测和识别

Requirements

python 3
tensorflow 1.5.0
keras
只在windows下进行了测试

Data

感谢EasyPR
demo测试时使用了EasyPR的数据库

Download

训练easypr方法时,请下载easypr_train_data.zip放到data目录下
测试时请下载data.zip放到data目录下 easypr的训练数据和各个模型的训练模型请从百度云上下载
将模型文件:

  1. whether_car_20180210T1049.zip
  2. chars_20180210T1038.zip
  3. mrcnn_20180212T2143.zip

解压放在output下。

最后data文件夹下目录结构是
├─demo
├─easypr_train_data
│ ├─chars
│ └─whether_car
├─general_test
├─GDSL.txt
└─使用说明.txt
output文件夹下目录结构是
├─chars_20180210T1038

├─mrcnn_20180212T2143

└─whether_car_20180210T1049

TODO

[] 写博客
[] multi-label的车牌识别
[] 更好的根据mask获得车牌精确4个点的算法
[] 轻量化

Done

[x] 重构代码
[x] mask-rcnn

Train

可以参考scripts下的训练脚本

Demo

切换不同方法时使用不同cfg即可,如将easypr.yml替换为maskrcnn.yml
demo

# 用easypr的方法
python demo.py --cfg cfgs/easypr.yml --path data/demo/test.jpg

功能测试

python func_test.py --cfg cfgs/easypr.yml

批量测试(data目录下需要有general_test目录)

python accuracy_test.py --cfg cfgs/easypr.yml

Question

  1. 训练mrcnn因为使用自己的数据,请注意一下数据格式

Reference

EasyPR
MaskRCNN

easypr-python's People

Contributors

sunskyf 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

easypr-python's Issues

关于车牌定位的方法

请问作者实现的python版本里面关于车牌定位的方法是哪几种?颜色、边缘、和文字吗?

why I use the accuracy_test to get the results which is 50%?

I use the accuracy_test of general test in demo.py . The results i get is only 50?

Accuracy test end!
Summary:
Total images: 203
Total time: 3832.75, Average time: 18.88
Match rate: 51.23%(104), locate rate: -22.65%
Not recognize:
陕AE8F80.jpg
湘A05H22.jpg
皖A45277.jpg
粤AAA379.jpg
浙A50819.jpg
津MN0888.jpg
川A82M83.jpg
浙A95044.jpg
浙A21027.jpg
浙AA4586.jpg
浙A12210.jpg
苏ADW072.jpg
皖M69311.jpg
粤AL6212.jpg
浙G70000.jpg
皖Q06417.jpg
粤B901BF.jpg
浙A68952.jpg
津LS2999.jpg
浙A72220.jpg
津E28437.jpg
湘A3685C.jpg
川A019W2.jpg
川A09X20.jpg
苏E75614.jpg
湘AT8781.jpg
浙AA2270.jpg
皖Q80197.jpg
皖A09T87.jpg
粤E9R439.JPG
浙JP291Q.jpg
皖A22T43.jpg
浙AC1847.jpg
皖BBC666.jpg
浙A03168.jpg
苏EB68W9.jpg
皖Q15538.jpg
津RB7992.jpg
皖Q0686学.jpg
川AA662F.jpg
津G68991.jpg
浙AA5547.jpg
浙A12903.jpg
皖A80003.jpg
粤B2757B.jpg
津MJY929.jpg
浙A13840.jpg
浙A54614.jpg

训练easypr时出错

测试了一下下载的模型,除了demo里面的test.jpg效果可以,很多其他车牌图片会出问题,想自己训练,但是训练easypr时出错,我的环境win10, python3.5.1, tensorflow 1.10,下面是训练指令

python ./models/train_net.py --data_dir data/easypr_train_data/chars --output_dir output/chars --batch_size 32 --lr 0.01 --net char --epoch 10

报错信息:
Traceback (most recent call last):
File "./models/train_net.py", line 83, in
train.train(dataset_train, dataset_val)
File "C:\Users\A4080599\Desktop\EasyPR-python-master\models\easypr\cnn_train.py", line 64, in train
tf.train.write_graph(self.sess.graph_def, model_dir, 'model.pb', False)
File "C:\Python35\lib\site-packages\tensorflow\python\framework\graph_io.py", line 66, in write_graph
if not file_io.file_exists(logdir) and not logdir.startswith('gs:'):
File "C:\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 260, in file_exists
pywrap_tensorflow.FileExists(compat.as_bytes(filename), status)
File "C:\Python35\lib\site-packages\tensorflow\python\util\compat.py", line 61, in as_bytes
(bytes_or_text,))
TypeError: Expected binary or unicode string, got WindowsPath('output/chars_20200402T0903/models')

@SunskyF请问有什么思路建议吗?谢谢

there is something wrong when I ran "demo"

When I ran the code "python demo.py --cfg cfgs/maskrcnn.yml --path data/demo/test.jpg",
It can get the key point of plate,but it can not recognize the plate.

File "demo.py", line 54, in
rec_res = chars_recognize(vis_image)
File "/Users/test/code/OCR/EasyPR-python/lib/recognizer.py", line 28, in recognize
return eval('recognize' + _methods[method])(src)
File "/Users/test/code/OCR/EasyPR-python/lib/recognizer.py", line 34, in _recognize_easypr
dir_name = find_last(cfg.OUTPUT_DIR, 'chars')
File "/Users/test/code/OCR/EasyPR-python/lib/utils/find_last.py", line 13, in find_last
dir_names = next(os.walk(output_dir))[1]
File "/Users/test/anaconda2/envs/pr/lib/python3.5/os.py", line 371, in walk
scandir_it = scandir(top)
TypeError: scandir: illegal type for path parameter

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.