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

Train on vertical patches #64

Closed lijo381 closed 3 years ago

lijo381 commented 4 years ago

I am trying to predict text from vertical images, where patch height is greater than width and the texts are arranged one below the other. Since the network is trained for horizontal text patches what changes do i need to make to get predictions on these kind of images??

weinman commented 4 years ago

Probably the most pain-free method would be to simply rotate your input images by -90º for both training and testing; assuming your training labels are arranged sequentially from top-to-bottom, the model should learn to read the top-to-bottom this as left-to-right in the actual (rotated) images.

Otherwise you'll be exchanging rows and columns throughout the model code