LPRNet车牌识别模型训练及CCPD数据集预处理
1 LPRNet车牌识别模型训练
1.1 源码:LPRNet_Pytorch-master
源码官网:GitHub - sirius-ai/LPRNet_Pytorch: Pytorch Implementation For LPRNet, A High Performance And Lightweight License Plate Recognition Framework.
链接:https://pan.baidu.com/s/1nMzJ2reDcGA6RJnHnNzcWg?pwd=lprn
提取码:lprn
本人上传的代码包含部分修改及训练测试命令等... ...
详询+V号: xuanze500
1.2 LPRNet_Pytorch训练及测试注意项
1.2.1 数据集
包含datas/train和datas/test文件夹,文件夹中是以车牌命名的.jpg文件,如“晋A30YS6.jpg”、“桂AR8501.jpg”、“鲁Q08L9D.jpg”等,且每一张.jpg的图是根据车牌四个角点截取的矩形车牌的图片。示例如下:
1.2.2 训练参数
(1)/LPRNet_Pytorch-master/train_LPRNet.py参数截取
def get_parser():
parser = argparse.ArgumentParser(description='parameters to train net')
parser.add_argument('--max_epoch', default=495, help='epoch to train the network') ##################
parser.add_argument('--img_size', default=[94, 24], help='the image size')
parser.add_argument('--train_img_dirs', default="/media/user/mydata/zzplates/train", help='the train images path')
parser.add_argument('--test_img_dirs', default="/media/user/mydata/zzplates/test", help='the test images path')
parser.add_argument('--dropout_rate', default=0.5, help='dropout rate.')
parser.add_argument('--learning_rate', default=0.0001, help='base value of learning rate.')
# parser.add_argument('--learning_rate', default=0.1, help='base value of learning rate.')
parser.add_argument('--lpr_max_len', default=8, help='license plate number max length.')
parser.add_argument('--train_batch_size', default=512, help='training batch size.')
parser.add_argument('--test_batch_size', default=128, help='testing batch size.')
parser.add_argument('--phase_train', default=True, type=bool, help='train or test phase flag.')
parser.add_argument('--num_workers', default=1, type=int, help='Number of workers used in dataloading')
parser.add_argument('--cuda', default=True, type=bool, help='Use cuda to train model')
parser.add_argument('--resume_epoch', default=0, type=int, help='resume iter for retraining')
parser.add_argument('--save_interval', default=5000, type=int, help='interval for save model state dict')
parser.add_argument('--test_interval', default=5000, type=int, help='interval for evaluate')
parser.add_argument('--momentum', default=0.9, type=float, help='momentum')
parser.add_argument('--weight_decay', default=2e-5, type=float, help='Weight decay for SGD')
parser.add_argument('--lr_schedule', default=[4, 8, 12, 14, 16], help='schedule for learning rate.')
parser.add_argument('--save_folder', default='./weights/', help='Location to save checkpoint models')
# parser.add_argument('--pretrained_model', default='', help='pretrained base model')
parser.add_argument('--pretrained_model', default='./weights/Final_LPRNet_model_gf.pth', help&#