lyl8213 / plate_recognition-lprnet Goto Github PK
View Code? Open in Web Editor NEWTensorflow based. Use CNN and CTC loss. It is a light network for Plate Recognition
Tensorflow based. Use CNN and CTC loss. It is a light network for Plate Recognition
Hi can you please write steps for training single lpr plate . your code seems to be for batch size 50.
I mean if i create a folder named test and put only one image . it should be able to give output.
请问 怎么训练自己的样本,我想训练自己的样本,但是不知道训练样本标签格式
Hi, before all amazing work with Plate Recognition - LPRnet implementation.
I have been trying to freeze the graph but I can't figure out the output layer to use on freeze_graph.
This is th freezing code I'm trying to use.
python3 ../tensorflow/tensorflow/python/tools/freeze_graph.py \
--input_graph=input.pb \
--input_binary=false \
--input_checkpoint=lprtf3.ckpt \
--output_graph=output.pb \
--output_node_name=??
The input.pb includes the result of the saves of
tf.train.write_graph(session.graph.as_graph_def(), MODEL_FOLDER, "input.pb")
Any ideas on what to use on output_node_name ??
Can this network output the bounding box of each character in the image?
In the paper, it is mentioned that "In total, the dataset contains 11696 cropped license plate images, which are split as 9:1 into training and validation subsets respectively".
However, the number of images in the train folder is only 752.
Can you please share the full dataset?
Do you have a single prediction script that goes by single image
This kind of function will be extremely helpful to your project
Hi @lyl8213 , thanks for your work.
I wonder can i train and recognize two line number plate with LPRnet ? e.g motorbike or number plate in other countries.
If I put python LPRtf3.py and
testthis is the output:
len(original_list) 50 len(detected_list) 1 test and detect length desn't match
time:0.7172296047210693
len(original_list) 50 len(detected_list) 1 test and detect length desn't match
time:0.7143244743347168
len(original_list) 50 len(detected_list) 1 test and detect length desn't match
What is it wrong?
is it possible to use checkpoints in your code for tranfser learning?
如果想要转换成pb模型,那么该模型的输出节点名称是什么呢?在哪一层进行转换呢,我尝试都失败了,感谢!
img_size = [94, 24]
inputs = tf.placeholder(tf.float32, shape=(b, img_size[0], img_size[1], num_channels))
however, the shape order should be [batchsize, height, width, channel]
如鲁AA1233变成 鲁A1233 ,目前输出是18长度,需要改大还是调空白符的阈值?有大神指导一下吗
I saw in your code when image processing,you made input shape to NWHC format:
'''python
images = np.transpose(images, axes=[0, 2, 1, 3])
'''
but in network building ,the default kernal shape is NHWC format.
so I'm not quite sure if it's my understanding issue or it's a bug in your code.
一张车牌识别需要60毫秒左右,怎么会和文章差距这么大
Hi @lyl8213
why we use this part of the code? what's the advantage of this part?
cx = mean(sqrt(x))
x = Lambda(lambda x: x[0]/x[1])([x,cx]) # division
x1 = AveragePooling2D(pool_size=[4,1],strides=[4,1],padding='same')(inputs)
cx1 = mean(sqrt(x1))
x1 = Lambda(lambda x: x[0]/x[1])([x1,cx1]) # division
x2 = AveragePooling2D(pool_size=[4,1],strides=[4,1],padding='same')(x2)
cx2 = mean(sqrt(x2))
x2 = Lambda(lambda x: x[0]/x[1])([x2,cx2]) # division
x3 = AveragePooling2D(pool_size=[2,1],strides=[2,1],padding='same')(x3)
cx3 = mean(sqrt(x3))
x3 = Lambda(lambda x: x[0]/x[1])([x3,cx3]) # division
x = concatenate([x,x1,x2,x3], axis=3)
车牌识别数据集,,包含多种车牌类型,各省份数量均匀且充足:qq1668486259
我可提供蓝色绿色黄色车牌数据以及相关代码,准确率可达95%+。q:1041357701
训练的现象如下:
Epoch 26/300, steps = 3822, train_cost = 0.000, logits_size = (24, 50, 67), val_cost = 12.472, val_ler = 0.146, time = 1.824s, learning_rate = 0.0009000000427477062 Epoch....... 26 Epoch 27/300, steps = 3969, train_cost = 0.000, logits_size = (24, 50, 67), val_cost = 13.910, val_ler = 0.148, time = 1.781s, learning_rate = 0.0009000000427477062 Epoch....... 27 Epoch 28/300, steps = 4116, train_cost = 0.000, logits_size = (24, 50, 67), val_cost = 13.581, val_ler = 0.156, time = 1.778s, learning_rate = 0.0008099999977275729 Epoch....... 28 Epoch 29/300, steps = 4263, train_cost = 0.000, logits_size = (24, 50, 67), val_cost = 13.747, val_ler = 0.156, time = 1.954s, learning_rate = 0.0008099999977275729
测试的现象如下:
len(original_list) 50 len(detected_list) 1 test and detect length desn't match time:0.2623302936553955 len(original_list) 50 len(detected_list) 1 test and detect length desn't match time:0.27623462677001953 len(original_list) 50 len(detected_list) 1 test and detect length desn't match time:0.2702765464782715 len(original_list) 50 len(detected_list) 1 test and detect length desn't match time:0.27227091789245605 len(original_list) 50 len(detected_list) 1 test and detect length desn't match
源文件LPRtf3.py的343行,log_prob有什么用?请问如何输出车牌的识别准确率呢?谢谢!
decoded, log_prob = tf.nn.ctc_beam_search_decoder(logits, seq_len, merge_repeated=False)
为什么达不到论文的95% ?
hello, and thank you for your awesome code can you please explain what the last number in your training data label is? I mean the ones and zeros at the end.
Epoch....... 33
Epoch 34/300, steps = 4998, train_cost = 0.000, train_ler = 0.000, val_cost = 1.423, val_ler = 0.023, time = 2.851s, learning_rate = 0.0008099999977275729
Epoch....... 34
time:0.9731936454772949
T/F: original(length) <-------> detectcted(length)
True Traceback (most recent call last):
File "LPRtf3.py", line 454, in
train(a)
File "LPRtf3.py", line 419, in train
c, steps = do_batch(train_gen,val_gen)
File "LPRtf3.py", line 406, in do_batch
do_report(val_gen,test_num)
File "LPRtf3.py", line 374, in do_report
report_accuracy(dd, test_targets)
File "LPRtf3.py", line 359, in report_accuracy
print(hit, number, "(", len(number), ") <-------> ", detect_number, "(", len(detect_number), ")")
UnicodeEncodeError: 'ascii' codec can't encode character '\u6d59' in position 2: ordinal not in range(128)
I see before train model i should set the label_len = 7 #the length of plate character, but i dot see where use this label_len
可提供一手车牌检测和车牌识别商用级别数据集,数据简介见链接:https://www.bilibili.com/video/bv1kU4y1e7Sb
UnboundLocalError Traceback (most recent call last)
in
444 if name == "main":
445 a = input('train or test:')
--> 446 train(a)
in train(a)
305 img_size=img_size,
306 num_channels=num_channels,
--> 307 label_len=label_len)
308
309 val_gen = TextImageGenerator(img_dir=vi,
in init(self, img_dir, label_file, batch_size, img_size, num_channels, label_len)
65 self.labels = []
66
---> 67 self.init()
68
69 def init(self):
i got this error every time i try to train or test
in init(self)
77 #else:
78 # label = dict[filename[:3]] + filename[4:10]
---> 79 label = encode_label(label)
80 self.labels.append(label)
81 self._num_examples += 1
UnboundLocalError: local variable 'label' referenced before assignment
it's like a bug, please fix it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.