Skip to content

Pytorch implementation of CRNN (CNN + RNN + CTCLoss) for all language OCR.

License

Notifications You must be signed in to change notification settings

vikramforsk2019/crnn-pytorch

Repository files navigation

Convolutional Recurrent Neural Network

This software implements the Convolutional Recurrent Neural Network (CRNN) in pytorch. Origin software could be found in crnn

Run crnn.ipynb

A demo program can be found in demo.py. Before running the demo, download a pretrained model from Baidu Netdisk or Dropbox. This pretrained model is converted from auther offered one by tool. Put the downloaded model file crnn.pth into directory data/. you have to upload on google drive.so you can use Multicloud to upload file fast https://www.multcloud.com/

Then launch the crnn.ipynb by:

on colab run the crnn.ipynb

The demo reads an example image and recognizes its text content. Example image:

Example Image

Expected output: loading pretrained model from ./data/crnn.pth n---a-m-e-y-o-u-w--a-ntt-- => nameyouwant
Example image: Example Image

Expected output: loading pretrained model from ./data/crnn.pth a-----v--a-i-l-a-bb-l-ee-- => available

Dependence

Train a new model

  1. Construct dataset following origin guide. If you want to train with variable length images (keep the origin ratio for example), please modify the tool/create_dataset.py and sort the image according to the text length.
  2. Execute python train.py --adadelta --trainRoot {train_path} --valRoot {val_path} --cuda. Explore train.py for details.

About

Pytorch implementation of CRNN (CNN + RNN + CTCLoss) for all language OCR.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published