GithubHelp home page GithubHelp logo

ufownl / alpr_utils Goto Github PK

View Code? Open in Web Editor NEW
168.0 3.0 48.0 42.95 MB

ALPR model in unconstrained scenarios for Chinese license plates

License: GNU General Public License v3.0

Python 100.00%
deep-learning deep-neural-networks license-plate-detection license-plate-recognition mxnet-gluon gluon-cv chinese-license-plate cnn transformer

alpr_utils's Introduction

ALPR utils

This is a DL model to detect & recognize Chinese license plates in unconstrained scenarios.

p1 p2 p3 p4 p5

Requirements

Download models

You can checkout the pre-trained models in pretrained/* branches.

Run a cli-demo

Simplest:

python3 test.py /path/to/image

Details:

$ python3 test.py --help
usage: test.py [-h] [--dims DIMS] [--threshold THRESHOLD] [--plt_w PLT_W]
               [--plt_h PLT_H] [--seq_len SEQ_LEN] [--no_yolo] [--beam]
               [--beam_size BEAM_SIZE] [--device_id DEVICE_ID] [--gpu]
               IMG [IMG ...]

Start a ALPR tester.

positional arguments:
  IMG                   path of the image file[s]

optional arguments:
  -h, --help            show this help message and exit
  --dims DIMS           set the sample dimentions (default: 208)
  --threshold THRESHOLD
                        set the positive threshold (default: 0.9)
  --plt_w PLT_W         set the max width of output plate images (default:
                        144)
  --plt_h PLT_H         set the max height of output plate images (default:
                        48)
  --seq_len SEQ_LEN     set the max length of output sequences (default: 8)
  --no_yolo             do not extract automobiles using YOLOv3
  --beam                using beam search
  --beam_size BEAM_SIZE
                        set the size of beam (default: 5)
  --device_id DEVICE_ID
                        select device that the model using (default: 0)
  --gpu                 using gpu acceleration

Run a demo server

Simplest:

python3 server.py

Details:

$ python3 server.py --help
usage: server.py [-h] [--dims DIMS] [--threshold THRESHOLD] [--plt_w PLT_W]
                 [--plt_h PLT_H] [--seq_len SEQ_LEN] [--beam_size BEAM_SIZE]
                 [--no_yolo] [--addr ADDR] [--port PORT]
                 [--device_id DEVICE_ID] [--gpu]

Start a ALPR demo server.

optional arguments:
  -h, --help            show this help message and exit
  --dims DIMS           set the sample dimentions (default: 208)
  --threshold THRESHOLD
                        set the positive threshold (default: 0.9)
  --plt_w PLT_W         set the max width of output plate images (default:
                        144)
  --plt_h PLT_H         set the max height of output plate images (default:
                        48)
  --seq_len SEQ_LEN     set the max length of output sequences (default: 8)
  --beam_size BEAM_SIZE
                        set the size of beam (default: 5)
  --addr ADDR           set address of ALPR server (default: 0.0.0.0)
  --port PORT           set port of ALPR server (default: 80)
  --device_id DEVICE_ID
                        select device that the model using (default: 0)
  --gpu                 using gpu acceleration

References

alpr_utils's People

Contributors

ufownl 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

alpr_utils's Issues

您好,提个问题

在dataset.py文件中

def load_dataset(root, filename="dataset.json")

这个dataset.json文件如何生成
数据集参考ccpd ccpd里面是一张张图片,它的文件名既为标签名,搞不懂如何将它转换为json文件
或者您能否提供我一份参考,谢谢

请教如何生成训练数据

您好,之前您说过车牌检测部分用fake_chs_lp生成的车牌图片做了数据扩增,车牌识别部分先用fake_chs_lp生成的车牌图像做预训练。我看了下fake_chs_lp,它是生成标准的车牌图像,能否简单描述下如何用它来做数据扩增得到车牌检测和车牌识别的训练数据呢?非常感谢!

我在请教一下

你好我还想在提个问题,车牌识别这部分(OCR),
1.我搞不懂它的流程,对图像编码解码,是seq2seq模型吗,这里为什么要这样处理
2.ocr的模型它是如何识别车牌字符?这里的大致流程是怎样的,您可以给一些参考吗

数据集

您好,能否提供一下数据集?

Dataset used

I am really sorry sir. I got my issue resolved that's why I removed it.
Thanks a lot for this wonderful repo.

训练数据

请问这里的车牌检测和车牌识别,分别用什么数据集来训练的?谢谢!

Permission error

Hi,when I run server.py:

File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
PermissionError: [Errno 13] Permission denied

Any idea on how to resolve this problem?thanks

about data

if possible, can you shale your processed image, or your dataset.json(mentioned in dataset.py)

no file: fake/chinese/random_plate

您好,在运行test.py时报错,发现主要是缺少文件 fake/chinese/random_plate

from .chinese import random_plate
ImportError: cannot import name 'random_plate'

请问能提供这个文件吗?谢谢

A docker image to help deployment

Hi,

Many thanks to this open-source model. I have made a docker image (for cpu) to help deployment.

git

git clone https://github.com/ufownl/alpr_utils.git
git checkout pretrained/master

docker

the default docker image work directory is '/intern', and the volume mounting from the source code (i.e., the git folder) to the default directory is needed.
docker pull qwtsc/mxnet
docker run -itd -v /TheAbsolutePathTo/alpr_utils:/intern -p 8882:80 qwtsc/mxnet /bin/bash -c "python3 server.py"

多种类车牌识别

尝试一些车牌发现只对单层的识别有效,想请问一下是训练数据没有考虑双层车牌的情况吗,比如中大型卡车、货车、挂车等很多后排都是双层黄牌,对双层黄牌的识别有没有什么指导建议,望回复,多谢!

使用CPU车牌识别耗时比较大,应该如何调整?

使用命令sudo python test.py /home/zjs/Desktop/车牌测试/ --no_yolo --beam
其中/home/zjs/Desktop/车牌测试/ 是一个目录,目录中包含了11张图片,有些图片中不含有车牌。
运行结果:
粤BD01940 0.9999888 /home/zjs/Desktop/车牌测试/0004.jpg
鲁H0A025 0.9999391 /home/zjs/Desktop/车牌测试/0006.jpeg
苏A2396V 0.99999833 /home/zjs/Desktop/车牌测试/1.jpg
吉AF16666 0.99992096 /home/zjs/Desktop/车牌测试/0002.jpeg
京HF5427 0.9999349 /home/zjs/Desktop/车牌测试/1.jpeg
湘DD08808 0.9999857 /home/zjs/Desktop/车牌测试/0001.jpeg
鲁鲁HC999 0.9942935 /home/zjs/Desktop/车牌测试/200.jpeg
耗时 9 s
11张图片中识别出了其中的7张图片,使用CPU的情况下需要9秒的时候,这个耗时还能否降低?

pretrained model

Great job.How can I get the pretrained model?Can you give me a the url?

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.