sirius-ai / LPRNet_Pytorch

Pytorch Implementation For LPRNet, A High Performance And Lightweight License Plate Recognition Framework.
Apache License 2.0
908 stars 227 forks source link

train_LPRNet.py文件中的Greedy_Decode_Eval函数,使用测试集评估模型的一些问题 #59

Closed regainOWO closed 2 years ago

regainOWO commented 3 years ago

在此处,prebs的shape是(batch_size, 68, 18) prebs = Net(images)

68是CHARS的长度,18代表着什么? 下面的if 语句 和 for 循环语句,我不太明白为什么要这么做,得到的结果虽然是正确的,但我还是百思不得其解

no_repeat_blank_label = list() pre_c = preb_label[0] if pre_c != len(CHARS) - 1: no_repeat_blank_label.append(pre_c) for c in preb_label: # dropout repeate label and blank label if (pre_c == c) or (c == len(CHARS) - 1): if c == len(CHARS) - 1: pre_c = c continue no_repeat_blank_label.append(c) pre_c = c preb_labels.append(no_repeat_blank_label)