/FFC-RNN

PyTorch Implementation of Fast Fourier Convolution-RNN with CTC loss for Handwritten Recognition

Primary LanguagePython

FFC-RNN

This is a PyTorch Implementation of FFC-RNN (Fast Fourier Convolution + RNN) with CTC loss for Handwritten Recognition.

Note: This work is highly inspired by Fast Fourier Convolution paper published in NIPS.

Dataset

This project aimed to perform handwritten recognition on Persian numbers written in text. In this way, we used specific parts(those containing numbers) of Sadri Dataset. This work has also been tested on IAM dataset. In order to run the code and train the model on your own data, you must create a directory similar to the one shown below and manipulate the code written in dataset.py:

data/images/ : contains images
data/labels/ : contains labels in text files
data/train.txt : contains the filenames for train set
data/test.txt : contains the filenames for test set

Sample Usage for Training the Model

!python train.py \
--exp 01 \
--learning_rate_decay 1 \
--learning_rate 0.0001 \
--char_based \
--exp_dir /path/to/experiments/directory \
--resume /path/to/saved/weights.pth \
--feature_extractor cnn \
--n_rnn 2 \
--imgW 128 \
--batch_size 64 \
--n_epochs 100 \
--data_root data \

Question

Of course, the code is not well-documented yet, and we have not completed a comprehensive guideline for using the code. So any questions or issues are welcome.