{"id":13415672,"url":"https://github.com/Canjie-Luo/MORAN_v2","last_synced_at":"2025-03-14T23:30:58.498Z","repository":{"id":54619877,"uuid":"164773628","full_name":"Canjie-Luo/MORAN_v2","owner":"Canjie-Luo","description":"MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition","archived":false,"fork":false,"pushed_at":"2024-07-25T10:12:40.000Z","size":2760,"stargazers_count":628,"open_issues_count":26,"forks_count":152,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-07-31T21:54:22.703Z","etag":null,"topics":["attention-mechanism","image-deformation","image-rectification","scene-text","scene-text-recognition"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Canjie-Luo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-09T02:43:29.000Z","updated_at":"2024-07-24T04:50:41.000Z","dependencies_parsed_at":"2024-10-26T12:06:00.441Z","dependency_job_id":"ff29d030-2463-4661-b9be-87fb51f3f16b","html_url":"https://github.com/Canjie-Luo/MORAN_v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canjie-Luo%2FMORAN_v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canjie-Luo%2FMORAN_v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canjie-Luo%2FMORAN_v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canjie-Luo%2FMORAN_v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Canjie-Luo","download_url":"https://codeload.github.com/Canjie-Luo/MORAN_v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663353,"owners_count":20327299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attention-mechanism","image-deformation","image-rectification","scene-text","scene-text-recognition"],"created_at":"2024-07-30T21:00:51.236Z","updated_at":"2025-03-14T23:30:58.143Z","avatar_url":"https://github.com/Canjie-Luo.png","language":"Python","funding_links":[],"categories":["2. \u003ca name='DeskewingandDewarping'\u003e\u003c/a\u003eDeskewing and Dewarping","Text detection and localization"],"sub_categories":["1.4. \u003ca name='OCRCLI'\u003e\u003c/a\u003eOCR CLI","Form Segmentation"],"readme":"# MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition\n\n![](https://img.shields.io/badge/version-v2-brightgreen.svg)\n\n| \u003ccenter\u003ePython 2.7\u003c/center\u003e | \u003ccenter\u003ePython 3.6\u003c/center\u003e |\n| :---: | :---: |\n| \u003ccenter\u003e[![Build Status](https://travis-ci.org/Canjie-Luo/MORAN_v2.svg?branch=master)](https://travis-ci.org/Canjie-Luo/MORAN_v2)\u003c/center\u003e | \u003ccenter\u003e[![Build Status](https://travis-ci.org/Canjie-Luo/MORAN_v2.svg?branch=master)](https://travis-ci.org/Canjie-Luo/MORAN_v2)\u003c/center\u003e |\n\nMORAN is a network with rectification mechanism for general scene text recognition. The paper (accepted to appear in Pattern Recognition, 2019) in [arXiv](https://arxiv.org/abs/1901.03003), [final](https://www.sciencedirect.com/science/article/pii/S0031320319300263) version is available now.\n\n[Here is a brief introduction in Chinese.](https://mp.weixin.qq.com/s/XbT_t_9C__KdyCCw8CGDVA)\n\n![](demo/MORAN_v2.gif)\n\n## Recent Update\n\n- 2019.03.21 Fix a bug about Fractional Pickup.\n- Support [Python 3](https://www.python.org/).\n\n## Improvements of MORAN v2:\n\n- More stable rectification network for one-stage training\n- Replace VGG backbone by ResNet\n- Use bidirectional decoder (a trick borrowed from [ASTER](https://github.com/bgshih/aster))\n\n| \u003ccenter\u003eVersion\u003c/center\u003e | \u003ccenter\u003eIIIT5K\u003c/center\u003e | \u003ccenter\u003eSVT\u003c/center\u003e | \u003ccenter\u003eIC03\u003c/center\u003e | \u003ccenter\u003eIC13\u003c/center\u003e | \u003ccenter\u003eSVT-P\u003c/center\u003e | \u003ccenter\u003eCUTE80\u003c/center\u003e | \u003ccenter\u003eIC15 (1811)\u003c/center\u003e | \u003ccenter\u003eIC15 (2077)\u003c/center\u003e |\n| :---: | :---: | :---: | :---:| :---:| :---:| :---:| :---:| :---:|\n| MORAN v1 (curriculum training)\\* | \u003ccenter\u003e91.2\u003c/center\u003e | \u003ccenter\u003e**88.3**\u003c/center\u003e | \u003ccenter\u003e**95.0**\u003c/center\u003e | \u003ccenter\u003e92.4\u003c/center\u003e | \u003ccenter\u003e76.1\u003c/center\u003e | \u003ccenter\u003e77.4\u003c/center\u003e | \u003ccenter\u003e74.7\u003c/center\u003e | \u003ccenter\u003e68.8\u003c/center\u003e |\n| \u003ccenter\u003eMORAN v2 (one-stage training)\u003c/center\u003e | \u003ccenter\u003e**93.4**\u003c/center\u003e | \u003ccenter\u003e**88.3**\u003c/center\u003e | \u003ccenter\u003e94.2\u003c/center\u003e | \u003ccenter\u003e**93.2**\u003c/center\u003e | \u003ccenter\u003e**79.7**\u003c/center\u003e | \u003ccenter\u003e**81.9**\u003c/center\u003e | \u003ccenter\u003e**77.8**\u003c/center\u003e | \u003ccenter\u003e**73.9**\u003c/center\u003e |\n\n\\*The results of v1 were reported in our paper. If this project is helpful for your research, please [cite](https://github.com/Canjie-Luo/MORAN_v2/blob/master/README.md#citation) our Pattern Recognition paper.\n\n## Requirements\n\n(Welcome to develop MORAN together.)\n\nWe recommend you to use [Anaconda](https://www.anaconda.com/) to manage your libraries.\n\n- [Python 2.7 or Python 3.6](https://www.python.org/) (Python 3 is faster than Python 2)\n- [PyTorch](https://pytorch.org/) 0.3.* (`Higher version causes slow training, please ref to` [issue#8](https://github.com/Canjie-Luo/MORAN_v2/issues/8#issuecomment-455416756))\n- [TorchVision](https://pypi.org/project/torchvision/)\n- [OpenCV](https://opencv.org/)\n- [PIL (Pillow)](https://pillow.readthedocs.io/en/stable/#)\n- [Colour](https://pypi.org/project/colour/)\n- [LMDB](https://pypi.org/project/lmdb/)\n- [matplotlib](https://pypi.org/project/matplotlib/)\n\nOr use [pip](https://pypi.org/project/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.)\n\n```bash\n    pip install -r requirements.txt\n```\n\n## Data Preparation\nPlease convert your own dataset to **LMDB** format by using the [tool](https://github.com/bgshih/crnn/blob/master/tool/create_dataset.py) (run in **Python 2.7**) provided by [@Baoguang Shi](https://github.com/bgshih). \n\nYou can also download the training ([NIPS 2014](http://www.robots.ox.ac.uk/~vgg/data/text/), [CVPR 2016](http://www.robots.ox.ac.uk/~vgg/data/scenetext/)) and testing datasets prepared by us. \n\n- [BaiduCloud (about 20G training datasets and testing datasets in **LMDB** format)](https://pan.baidu.com/s/1TqZfvoEhyv57yf4YBjSzFg), password: l8em\n- [Google Drive (testing datasets in **LMDB** format)](https://drive.google.com/open?id=1NAs78a38xkl1MhodoD7BM0Lh3v_sFwYs)\n- [OneDrive (testing datasets in **LMDB** format)](https://1drv.ms/f/s!Am3wqyDHs7r0hkHUYy0edaC2UC3c)\n\nThe raw pictures of testing datasets can be found [here](https://github.com/chengzhanzhan/STR).\n\n## Training and Testing\n\nModify the path to dataset folder in `train_MORAN.sh`:\n\n```bash\n\t--train_nips path_to_dataset \\\n\t--train_cvpr path_to_dataset \\\n\t--valroot path_to_dataset \\\n```\n\nAnd start training: (manually decrease the learning rate for your task)\n\n```bash\n\tsh train_MORAN.sh\n```\n- The training process should take **less than 20s** for 100 iterations on a 1080Ti.\n\n## Demo\n\nDownload the model parameter file `demo.pth`.\n\n- [BaiduCloud](https://pan.baidu.com/s/1TqZfvoEhyv57yf4YBjSzFg) (password: l8em)\n- [Google Drive](https://drive.google.com/file/d/1IDvT51MXKSseDq3X57uPjOzeSYI09zip/view?usp=sharing)\n- [OneDrive](https://1drv.ms/u/s!Am3wqyDHs7r0hkAl0AtRIODcqOV3)\n\nPut it into root folder. Then, execute the `demo.py` for more visualizations.\n\n```bash\n\tpython demo.py\n``` \n\n![](demo/demo.png)\n\n## Citation\n\n```\n@article{cluo2019moran,\n  author    = {Canjie Luo and Lianwen Jin and Zenghui Sun},\n  title     = {MORAN: A Multi-Object Rectified Attention Network for Scene Text Recognition},\n  journal   = {Pattern Recognition}, \n  volume    = {90}, \n  pages     = {109--118},\n  year      = {2019},\n  publisher = {Elsevier}\n}\n```\n\n## Acknowledgment\nThe repo is developed based on [@Jieru Mei's](https://github.com/meijieru) [crnn.pytorch](https://github.com/meijieru/crnn.pytorch) and [@marvis'](https://github.com/marvis) [ocr_attention](https://github.com/marvis/ocr_attention). Thanks for your contribution.\n\n## Attention\nThe project is only free for academic research purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCanjie-Luo%2FMORAN_v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCanjie-Luo%2FMORAN_v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCanjie-Luo%2FMORAN_v2/lists"}