Awesome
MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition
<center>Python 2.7</center> | <center>Python 3.6</center> |
---|---|
<center></center> | <center></center> |
MORAN is a network with rectification mechanism for general scene text recognition. The paper (accepted to appear in Pattern Recognition, 2019) in arXiv, final version is available now.
Here is a brief introduction in Chinese.
Recent Update
- 2019.03.21 Fix a bug about Fractional Pickup.
- Support Python 3.
Improvements of MORAN v2:
- More stable rectification network for one-stage training
- Replace VGG backbone by ResNet
- Use bidirectional decoder (a trick borrowed from ASTER)
<center>Version</center> | <center>IIIT5K</center> | <center>SVT</center> | <center>IC03</center> | <center>IC13</center> | <center>SVT-P</center> | <center>CUTE80</center> | <center>IC15 (1811)</center> | <center>IC15 (2077)</center> |
---|---|---|---|---|---|---|---|---|
MORAN v1 (curriculum training)* | <center>91.2</center> | <center>88.3</center> | <center>95.0</center> | <center>92.4</center> | <center>76.1</center> | <center>77.4</center> | <center>74.7</center> | <center>68.8</center> |
<center>MORAN v2 (one-stage training)</center> | <center>93.4</center> | <center>88.3</center> | <center>94.2</center> | <center>93.2</center> | <center>79.7</center> | <center>81.9</center> | <center>77.8</center> | <center>73.9</center> |
*The results of v1 were reported in our paper. If this project is helpful for your research, please cite our Pattern Recognition paper.
Requirements
(Welcome to develop MORAN together.)
We recommend you to use Anaconda to manage your libraries.
- Python 2.7 or Python 3.6 (Python 3 is faster than Python 2)
- PyTorch 0.3.* (
Higher version causes slow training, please ref to
issue#8) - TorchVision
- OpenCV
- PIL (Pillow)
- Colour
- LMDB
- matplotlib
Or use pip to install the libraries. (Maybe the torch is different from the anaconda version. Please check carefully and fix the warnings in training stage if necessary.)
pip install -r requirements.txt
Data Preparation
Please convert your own dataset to LMDB format by using the tool (run in Python 2.7) provided by @Baoguang Shi.
You can also download the training (NIPS 2014, CVPR 2016) and testing datasets prepared by us.
- BaiduCloud (about 20G training datasets and testing datasets in LMDB format), password: l8em
- Google Drive (testing datasets in LMDB format)
- OneDrive (testing datasets in LMDB format)
The raw pictures of testing datasets can be found here.
Training and Testing
Modify the path to dataset folder in train_MORAN.sh
:
--train_nips path_to_dataset \
--train_cvpr path_to_dataset \
--valroot path_to_dataset \
And start training: (manually decrease the learning rate for your task)
sh train_MORAN.sh
- The training process should take less than 20s for 100 iterations on a 1080Ti.
Demo
Download the model parameter file demo.pth
.
- BaiduCloud (password: l8em)
- Google Drive
- OneDrive
Put it into root folder. Then, execute the demo.py
for more visualizations.
python demo.py
Citation
@article{cluo2019moran,
author = {Canjie Luo and Lianwen Jin and Zenghui Sun},
title = {MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition},
journal = {Pattern Recognition},
volume = {90},
pages = {109--118},
year = {2019},
publisher = {Elsevier}
}
Acknowledgment
The repo is developed based on @Jieru Mei's crnn.pytorch and @marvis' ocr_attention. Thanks for your contribution.
Attention
The project is only free for academic research purposes.