watsonyanghx / CNN_LSTM_CTC_Tensorflow

CNN+LSTM+CTC based OCR implemented using tensorflow.
MIT License
362 stars 210 forks source link

the num of num_classes #27

Open saberSabersaber opened 6 years ago

saberSabersaber commented 6 years ago

hi, thank you for your codes. I am confused by the num_classes,. +- + () + 10 digit + blank + space num_classes = 3 + 2 + 10 + 1 + 1 I understand the ctc loss need to add a special ctc_blank, but there is no space in the label ,why there are add two 1 ? I notice that in the training phase, the code run the below part to generate label charset = '0123456789+-()' encode_maps = {} decode_maps = {} for i, char in enumerate(charset, 1): encode_maps[char] = i decode_maps[i] = char

SPACE_INDEX = 0 SPACE_TOKEN = '' encode_maps[SPACE_TOKEN] = SPACE_INDEX decode_maps[SPACE_INDEX] = SPACE_TOKEN I mean there is no space in you lable, so if remove encode_maps[SPACE_TOKEN] = SPACE_INDEX, does the num_class will not need to add another 1?

zhoukaii commented 4 years ago

same question can i use my data to train?