Giter Club home page Giter Club logo

license-plate-recoginition's Introduction

车牌识别

车牌识别部分,参考LPRNetMulti-line license plate recognition

车牌数据生成,参考fake_chs_lpalpr_utils

理论上该网络可以识别单双行,只要添加数据训练,当前训练数据均为生成数据

数据来源

  • CCPD2019,CCPD2020,裁切矫正车牌,参考prepare_ccpd.py
  • 生成数据,通过gen_data.py生成数据集,每类车牌及细分类别的生成概率可通过配置文件config_gen.py配置
  • 生成数据有使用贴图,可在data/env_imgs中添加背景素材
  • 车牌标签以文件名方式保存和读取,'日期'-'种类'-'号码'-'时间戳',如 20220122-green+b-藏AQ2580D-1642860498000912.jpg

训练

  • 修改训练的参数配置文件lpr.yml,一般修改保存路径、train和test数据路径,因为标签以文件名方式读取,只需要添加文件夹路径即可
  • 修改配置文件后,python train.py config/lpr.yml开始训练
  • 建议单卡训练(多卡eval未修改),小的BatchSize对指标并无影响 测试
  • 评估指标 python test.py --task val --config lpr-d.yml --model path/to/your/model
  • 结果测试 python inference.py --task val --config lpr-d.yml --model path/to/your/model --path path/to/your/img

支持车牌种类

  • 蓝色单层车牌
  • 黄色单层车牌
  • 绿色新能源车牌、民航车牌
  • 黑色单层车牌
  • 白色警牌、军牌、武警车牌
  • 黄色双层车牌
  • 绿色农用车牌
  • 白色双层军牌

车牌检测参考:https://github.com/gm19900510/Pytorch_Retina_License_Plate

license-plate-recoginition's People

Contributors

chhanxiao 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

Watchers

 avatar  avatar

license-plate-recoginition's Issues

TypeError: 'NoneType' object is not callable

File "gen_data.py", line 70, in main
img, lab, color = gen()
File "gen_data.py", line 35, in call
com = aug(image=com)['image']
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\core\composition.py", line 210, in call
data = t(force_apply=force_apply, **data)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\core\transforms_interface.py", line 97, in call
return self.apply_with_params(params, **kwargs)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\core\transforms_interface.py", line 112, in apply_with_params
res[key] = target_function(arg, **dict(params, **target_dependencies))
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\augmentations\geometric\transforms.py", line 868, in apply
return F.piecewise_affine(img, matrix, self.interpolation, self.mode, self.cval)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\augmentations\functional.py", line 40, in wrapped_function
return clip(func(img, *args, **kwargs), dtype, maxval)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\albumentations\augmentations\geometric\functional.py", line 614, in piecewise_affine
img, matrix, order=interpolation, mode=mode, cval=cval, preserve_range=True, output_shape=img.shape
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\skimage\transform_warps.py", line 976, in warp
coords = warp_coords(coord_map, output_shape)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\skimage\transform_warps.py", line 675, in warp_coords
tf_coords = coord_map(tf_coords)
File "D:\Anaconda3\envs\zx_plate\lib\site-packages\skimage\transform_warps.py", line 967, in coord_map
return inverse_map(*args, **map_args)
TypeError: 'NoneType' object is not callable

在运行一段时间后会出现该错误,请问博主该怎么解决呢?

LPR

博主您好,想问一下为啥要将LPR的输出序列长度设置为18呢

报错:ValueError: num_samples should be a positive integer value, but got num_samples=0

Traceback (most recent call last):
File "E:/PycharmProjects/Vehicle_Detection/license-plate-recoginition-main/license-plate-recoginition-main/train.py", line 100, in
main(args)
File "E:/PycharmProjects/Vehicle_Detection/license-plate-recoginition-main/license-plate-recoginition-main/train.py", line 57, in main
drop_last=True,
File "C:\Users\wangwy\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 266, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore
File "C:\Users\wangwy\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 104, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0

测试程序在哪

代码里的权重是否包含特殊车辆和双行车牌的训练,测试代码在哪里还是自己写一个

torch.split的作用

请问网络中torch.split起到了什么作用,试图将双行切割?那么单行得那?请问那部分可以最有效得针对双行识别

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.