This repo details the implementation of a model that can function as an OCR for cursive handwriting. The dataset utilised is the IAM Dataset.
The architecture 1st passes the input image into a series of Conv2D layers. The output is then reshaped to a (batch_size, time_steps, depth) shape. This is then passed through an LSTM based seq2seq encoder-decoder system (seq2seq architecture shown below).

Note: The text input to the decoder and outputs are tokenized and one-hot-encoded hence the loss used is categorical crossentropy rather than the CTC loss usually used for OCR based CRNN tasks.
First Generate the labels:
$ python3 label_gen.py To train the model:
$ python3 main.py From line 159 in main.py onwards is the inference code which can be tested by selective running or by utilizing in another python file.
