Skip to content

axe76/Handwriting_CRNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handwriting_CRNN

This repo details the implementation of a model that can function as an OCR for cursive handwriting. The dataset utilised is the IAM Dataset.

Architecture

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).
seq2seq

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.

Usage

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.

Working

Input image:
test

Predicted output:
pred

About

OCR for cursive handwriting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages