weinman / cnn_lstm_ctc_ocr

Tensorflow-based CNN+LSTM trained with CTC-loss for OCR
GNU General Public License v3.0
498 stars 170 forks source link

Fixed sequence length #61

Closed SnehalRaj closed 4 years ago

SnehalRaj commented 5 years ago

I am working with a real life dataset where I am getting quite good results with your code. However, most of the errors, I believe are due to an incorrect prediction of sequence length. My dataset has words which are of fixed length(and format too). Is there any way where I could modify the code so it would predict sequences, of the length (and in the format) I specify it?

weinman commented 5 years ago

Connectionist Temporal Classification (CTC) is targeted for aligning input and output label sequences, particularly where the length is variable. To address your use case, you'll likely need to change the loss function for a different encoding/merging scheme and the decoder to output fixed sequence lengths.