项目作者: GitYCC

项目描述 :
Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition using Pytorch
高级语言: Python
项目地址: git://github.com/GitYCC/crnn-pytorch.git
创建时间: 2020-09-02T05:41:19Z
项目社区:https://github.com/GitYCC/crnn-pytorch

开源协议:

下载


CRNN Pytorch

python3.6

Quick Demo

  1. $ pip install -r requirements.txt
  2. $ python src/predict.py -h

Everything is okay. Let’s predict the demo images.

  1. $ python src/predict.py demo/*.jpg
  2. device: cpu
  3. Predict: 100% [00:00<00:00, 4.89it/s]
  4. ===== result =====
  5. demo/170_READING_62745.jpg > reading
  6. demo/178_Showtime_70541.jpg > showtime
  7. demo/78_Novel_52433.jpg > novel

novel
novel
novel

CRNN + CTC

This is a Pytorch implementation of a Deep Neural Network for scene text recognition. It is based on the paper “An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition (2016), Baoguang Shi et al.”.

Blog article with more info: https://ycc.idv.tw/crnn-ctc.html

crnn_structure

Download Synth90k dataset

  1. $ cd data
  2. $ bash download_synth90k.sh
  1. @InProceedings{Jaderberg14c,
  2. author = "Max Jaderberg and Karen Simonyan and Andrea Vedaldi and Andrew Zisserman",
  3. title = "Synthetic Data and Artificial Neural Networks for Natural Scene Text Recognition",
  4. booktitle = "Workshop on Deep Learning, NIPS",
  5. year = "2014",
  6. }
  7. @Article{Jaderberg16,
  8. author = "Max Jaderberg and Karen Simonyan and Andrea Vedaldi and Andrew Zisserman",
  9. title = "Reading Text in the Wild with Convolutional Neural Networks",
  10. journal = "International Journal of Computer Vision",
  11. number = "1",
  12. volume = "116",
  13. pages = "1--20",
  14. month = "jan",
  15. year = "2016",
  16. }

Pretrained Model

We pretrained the RCNN model on Synth90k dataset. The weights saved at checkpoints/crnn_synth90k.pt.

Evaluate the model on the Synth90k dataset

  1. $ python src/evaluate.py

Evaluate on 891927 Synth90k test images:

  • Test Loss: 0.53042
Decoded Method Sequence Accuracy Prediction Time
greedy 0.93873 0.44398 ms/image
beam_search (beam_size=10) 0.93892 6.9120 ms/image
prefix_beam_search (beam_size=10) 0.93900 42.598 ms/image

Train your model

You could adjust hyper-parameters in ./src/config.py.

And train crnn models,

  1. $ python src/train.py

Acknowledgement

Please cite this repo. crnn-pytorch if you use it.