Β«LPDetΒ» provides a complete License Plate Detection and Recognition algorithm
This warehouse provides a complete license plate detection and recognition algorithm, with the goal of perfectly detecting and recognizing all license plates and license plate information.
$ pip install -r requirements.txt
CCPD2019/ccpd_base
CCPD2019/ccpd_weather
Firstly, train the license plate detection model: wR2
python -m torch.distributed.run --nproc_per_node 4 --master_port 16233 train_wr2.py --device 4,5,6,7 ../datasets/CCPD2019/ccpd_base ../datasets/CCPD2019/ccpd_weather runs/train
_wr2_ddp
Then, train both license plate detection and recognition models simultaneously: RPNet
python -m torch.distributed.run --nproc_per_node 4 --master_port 32312 train_rpnet.py --device 0,1,2,3 --wr2-pretrained runs/train_wr2_ddp/wR2-e95.pth ../datasets/CCPD2019/ccpd_bas
e ../datasets/CCPD2019/ccpd_weather runs/train_rpnet_ddp
$ python eval_wr2.py runs/train_wr2_ddp/wR2-e100.pth /data/sdd/CCPD2019/ccpd_weather/
args: Namespace(pretrained='runs/train_wr2_ddp/wR2-e100.pth', val_root='/data/sdd/CCPD2019/ccpd_weather/')
Loading wR2 pretrained: runs/train_wr2_ddp/wR2-e100.pth
Get val data: /data/sdd/CCPD2019/ccpd_weather/
Dataset len: 9999
Batch:312 AP:100.000: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 313/313 [00:53<00:00, 5.89it/s]
AP:96.650
$ python eval_rpnet.py runs/train_rpnet_ddp/RPNet-e100.pth ../datasets/CCPD2019/ccpd_weather/
args: Namespace(pretrained='runs/train_rpnet_ddp/RPNet-e100.pth', val_root='../datasets/CCPD2019/ccpd_weather/')
Loading RPNet pretrained: runs/train_rpnet_ddp/RPNet-e100.pth
Get train data: ../datasets/CCPD2019/ccpd_weather/
Dataset len: 9999
Batch:312 AP:100.000 ACC: 100.000: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 313/313 [00:52<00:00, 5.94it/s]
AP:97.400 ACC: 97.930
$ python predict_wr2.py runs/train_wr2_ddp/wR2-e100.pth assets/eval/4.jpg
args: Namespace(image='assets/eval/4.jpg', wr2='runs/train_wr2_ddp/wR2-e100.pth')
Loading wR2 pretrained: runs/train_wr2_ddp/wR2-e100.pth
torch.Size([1, 4])
Save to runs/4_wr2.jpg
$ python predict_rpnet.py runs/train_rpnet_ddp/RPNet-e100.pth assets/eval/4.jpg
args: Namespace(image='assets/eval/4.jpg', rpnet='runs/train_rpnet_ddp/RPNet-e100.pth')
Loading RPNet pretrained: runs/train_rpnet_ddp/RPNet-e100.pth
torch.Size([1, 242])
lp_name: ηA256R2
Save to runs/4_rpnet.jpg
Anyone's participation is welcome! Open an issue or submit PRs.
Small note:
Apache License 2.0 Β© 2023 zjykzj