qjadud1994 / CRNN-Keras

CRNN (CNN+RNN) for OCR using Keras / License Plate Recognition
MIT License
527 stars 191 forks source link

decode_label() function #18

Open soldierofhell opened 5 years ago

soldierofhell commented 5 years ago

Is there any special purpose to implement custom decode function instead of using (more general) keras.backend.ctc_decode()?

szm-R commented 5 years ago

Hi @qjadud1994 I'm trying to customize your code for my own data, where I have plates with 8 numbers (with different characters in the middle). However, I don't understand your decode function. More specifically, I don't understand why your output's shape is (1,32,42). I know that you have 41 letters, but shouldn't the model predict 9 set of 42 scores (instead of 32)? So that getting the maximum index out of each would lead to a 9 character license plate, as in your example images?

ghost commented 5 years ago

Hi @szm2015 , the 32 is for segmentation of feature map that generated by CNN, in dead this is similar to segmentation the input image to 32 segmentation, and we select 8 unique character from 32 label character for each segment in the decode section.