Pytorch Implementation For LPRNet, A High Performance And Lightweight License Plate Recognition Framework.
完全适用于**车牌识别(Chinese License Plate Recognition)及国外车牌识别!
目前仅支持同时识别蓝牌和绿牌即新能源车牌等**车牌,但可通过扩展训练数据或微调支持其他类型车牌及提高识别准确率!
- pytorch >= 1.0.0
- opencv-python 3.x
- python 3.x
- imutils
- Pillow
- numpy
- prepare your datasets, image size must be 94x24.
- base on your datsets path modify the scripts its hyperparameters --train_img_dirs or --test_img_dirs.
- adjust other hyperparameters if need.
- run 'python train_LPRNet.py' or 'python test_LPRNet.py'.
- if want to show testing result, add '--show true' or '--show 1' to run command.
- personal test datasets.
- include blue/green license plate.
- images are very widely.
- total test images number is 27320.
size | personal test imgs(%) | inference@gtx 1060(ms) |
---|---|---|
1.7M | 96.0+ | 0.5- |
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip3 install imutils
find . -type f -name 'Z*.jpg' | tail -n 1 | xargs -I {} mv {} /home/ye/CODE/MY/LPRNet_Pytorch/data/test/Brazil
- AttributeError: module 'numpy' has no attribute 'int'.
- 解决办法:将numpy的方法np.int改为np.int_
- AttributeError: module 'torch.utils.data' has no attribute 'collate'
- 解决办法:将
D:\bin\Anaconda3\lib\site-packages\torch\utils\data\_utils\collate.py
文件复制到上一级目录D:\bin\Anaconda3\lib\site-packages\torch\utils\data\collate.py
即可
- 解决办法:将
- cv2.destroyAllWindows() => cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1295: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvDestroyAllWindows'
- 解决办法:重新安装
opencv-contrib-python
pip uninstall opencv-contrib-python pip install opencv-contrib-python
- 解决办法:重新安装
- ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (100,) + inhomogeneous part.
- 解决办法:
pip uninstall numpy pip install numpy==1.22.3