Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bgshih/crnn
Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition.
https://github.com/bgshih/crnn
computer-vision machine-learning ocr sequence-recognition torch7
Last synced: 3 days ago
JSON representation
Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition.
- Host: GitHub
- URL: https://github.com/bgshih/crnn
- Owner: bgshih
- License: mit
- Created: 2015-12-19T07:14:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T05:12:37.000Z (over 5 years ago)
- Last Synced: 2024-03-09T08:36:02.912Z (4 months ago)
- Topics: computer-vision, machine-learning, ocr, sequence-recognition, torch7
- Language: Lua
- Size: 73.2 KB
- Stars: 2,031
- Watchers: 81
- Forks: 549
- Open Issues: 91
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-ocr - Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition.
- awesome-stars - bgshih/crnn - Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition. (Lua)
- wanghaisheng-awesome-ocr - Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition.
- CV-pretrained-model - An End-to-End Trainable Neural Network for Image-based Sequence Recognition - based sequence recognition tasks, such as scene text recognition and OCR. | `PyTorch`| [The MIT License (MIT)]( https://raw.githubusercontent.com/bgshih/crnn/master/LICENSE ) (Model Deployment library / PyTorch <a name="pytorch"/>)
- awesome-ocr - offical - [crnn.pytorch](https://github.com/meijieru/crnn.pytorch)】; 【3 - [unfinished](https://github.com/Belval/CRNN)】; 【4 - [crnn.pytorch-chinese](https://github.com/wulivicte/crnn)】; 【5 - [crnn+stn-tf](https://github.com/chengzhang/CRNN)】; 【6 - [lstm+ctc](https://github.com/ilovin/lstm_ctc_ocr)】; 【7 - [ctpn+crnn-merge-cannot-train](https://github.com/bear63/sceneReco)】; 【8 - [crnn-mnist-keras](https://github.com/jamesmf/mnistCRNN)】; 【9 - [crnn-tf](https://github.com/TJCVRS/CRNN_Tensorflow)】; 【10 - [crnn-tf-could-be-better](https://github.com/AimeeKing/crnn-tensorflow)】; 【11 - [crnn.mxnet](https://github.com/novioleo/crnn.mxnet)】; 【12 - [crnn-tf-estimators](https://github.com/solivr/tf-crnn)】; 【13 - [crnn-attention-tf](https://github.com/wushilian/CRNN_Attention_OCR_Chinese)】; 【14 - [crnn.caffe](https://github.com/yalecyu/crnn.caffe)】; 【15 - [chinese.ocr-ctpn+crnn-tf+pytorch](https://github.com/chineseocr/chinese-ocr)】; 【16 - [another.crnn-attentive pooling](https://github.com/desh2608/crnn-relation-classification)】; 【17 - [crnn-tf-music](https://github.com/meetshah1995/crnn-music-genre-classification)】; 【18 - [crnn-tf-developing](https://github.com/wcy940418/CRNN-end-to-end)】; 【19 - [crnn-torch](https://github.com/yisongbetter/crnn)】; 【20 - [crnn-tf-developing](https://github.com/caihaoye16/crnn)】; 【21 - [chinese-ocr-keras](https://github.com/hehongyu1995/chinese-ocr-train)】; 【22 - [crnn-tf-developing](https://github.com/qiaohan/crnn-train-tf)】; 【23 - [ctpn+crnn-cannot-train-7](https://github.com/qq919056489/ScenceRecognition)】; 【24 - [crnn-pytorch](https://github.com/ahmedmazari-dhatim/CRNN-for-sequence-recognition-)】; 【25 - [cnn+lstm+ctc-tf](https://github.com/watsonyanghx/CNN_LSTM_CTC_Tensorflow)】; 【26 - [crnn-tf-resnet](https://github.com/shoaibahmed/CRNN-TF)]】;【27 - [caffe_ocr](https://github.com/senlinuc/caffe_ocr)】 (Text image recognition / 2015)
- awesome-ocr - Convolutional Recurrent Neural Network (CRNN) for image-based sequence recognition.
README
Convolutional Recurrent Neural Network
======================================This software implements the Convolutional Recurrent Neural Network (CRNN), a combination of CNN, RNN and CTC loss for image-based sequence recognition tasks, such as scene text recognition and OCR. For details, please refer to our paper http://arxiv.org/abs/1507.05717.
**UPDATE Mar 14, 2017** A Docker file has been added to the project. Thanks to [@varun-suresh](https://github.com/varun-suresh).
**UPDATE May 1, 2017** A PyTorch [port](https://github.com/meijieru/crnn.pytorch) has been made by [@meijieru](https://github.com/meijieru).
**UPDATE Jun 19, 2017** For an end-to-end text detector+recognizer, check out the [CTPN+CRNN implementation](https://github.com/AKSHAYUBHAT/DeepVideoAnalytics/tree/master/notebooks/OCR) by [@AKSHAYUBHAT](https://github.com/AKSHAYUBHAT).
Build
-----The software has only been tested on Ubuntu 14.04 (x64). CUDA-enabled GPUs are required. To build the project, first install the latest versions of [Torch7](http://torch.ch), [fblualib](https://github.com/facebook/fblualib) and LMDB. Please follow their installation instructions respectively. On Ubuntu, lmdb can be installed by ``apt-get install liblmdb-dev``.
To build the project, go to ``src/`` and execute ``sh build_cpp.sh`` to build the C++ code. If successful, a file named ``libcrnn.so`` should be produced in the ``src/`` directory.
Run demo
--------A demo program can be found in ``src/demo.lua``. Before running the demo, download a pretrained model from [here](https://www.dropbox.com/s/tx6cnzkpg99iryi/crnn_demo_model.t7?dl=0). Put the downloaded model file ``crnn_demo_model.t7`` into directory ``model/crnn_demo/``. Then launch the demo by:
th demo.lua
The demo reads an example image and recognizes its text content.
Example image:
![Example Image](./data/demo.png)Expected output:
Loading model...
Model loaded from ../model/crnn_demo/model.t7
Recognized text: available (raw: a-----v--a-i-l-a-bb-l-e---)
Another example:
![Example Image2](./data/demo2.jpg)Recognized text: shakeshack (raw: ss-h-a--k-e-ssh--aa-c--k--)
Use pretrained model
--------------------The pretrained model can be used for lexicon-free and lexicon-based recognition tasks. Refer to the functions ``recognizeImageLexiconFree`` and ``recognizeImageWithLexicion`` in file ``utilities.lua`` for details.
Train a new model
-----------------Follow the following steps to train a new model on your own dataset.
1. Create a new LMDB dataset. A python program is provided in ``tool/create_dataset.py``. Refer to the function ``createDataset`` for details (need to ``pip install lmdb`` first).
2. Create model directory under ``model/``. For example, ``model/foo_model``. Then create
configuraton file ``config.lua`` under the model directory. You can copy ``model/crnn_demo/config.lua`` and do modifications.
3. Go to ``src/`` and execute ``th main_train.lua ../models/foo_model/``. Model snapshots and logging file will be saved into the model directory.Build using docker
------------------1. Install docker. Follow the instructions [here](https://docs.docker.com/engine/installation/)
2. Install nvidia-docker - Follow the instructions [here](https://github.com/NVIDIA/nvidia-docker)
3. Clone this repo, from this directory run `docker build -t crnn_docker .`
4. Once the image is built, the docker can be run using `nvidia-docker run -it crnn_docker`.
Citation
--------Please cite the following paper if you are using the code/model in your research paper.
@article{ShiBY17,
author = {Baoguang Shi and
Xiang Bai and
Cong Yao},
title = {An End-to-End Trainable Neural Network for Image-Based Sequence Recognition
and Its Application to Scene Text Recognition},
journal = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
volume = {39},
number = {11},
pages = {2298--2304},
year = {2017}
}Acknowledgements
----------------The authors would like to thank the developers of Torch7, TH++, [lmdb-lua-ffi](https://github.com/calind/lmdb-lua-ffi) and [char-rnn](https://github.com/karpathy/char-rnn).
Please let me know if you encounter any issues.