在本专题前面相关博客中已经讲述了 车牌检测与车牌识别算法的模型训练操作步骤以及数据集的制作过程。
本博文将结合前面训练好的模型来实现车牌的检测与识别。并用tkinter实现界面。最终通过检测车牌检测的前后时间来实现 时间与费用的统计计算展示。
1)修改检测函数
在yolov5检测函数的基础上进行修改,增加识别车牌的功能
def detect(opt,source,save_path,save_img=False):
classify, out, det_weights, rec_weights, view_img, save_txt, imgsz = \
opt.classify, opt.output, opt.det_weights, opt.rec_weights, opt.view_img, opt.save_txt, opt.img_size
webcam = source == '0' or source.startswith('rtsp') or source.startswith('http') or source.endswith('.txt')
# Initialize
device = torch_utils.select_device(opt.device)
if os.path.exists(out):
shutil.rmtree(out) # delete rec_result folder
os.makedirs(out) # make new rec_result folder
half = device.type != 'cpu' # half preci
本文档介绍如何利用已训练好的车牌检测与识别模型,结合tkinter构建界面,实现实时车牌检测、识别及时间费用统计。主要内容包括修改YOLOv5检测函数以增加分类识别,设计用户界面,并展示检测结果。
订阅专栏 解锁全文
493

被折叠的 条评论
为什么被折叠?



