{"id":13564503,"url":"https://github.com/Megvii-CSG/MegReader","last_synced_at":"2025-04-03T21:31:00.551Z","repository":{"id":38420068,"uuid":"211424825","full_name":"Megvii-CSG/MegReader","owner":"Megvii-CSG","description":"A research project for text detection and recognition using PyTorch 1.2.","archived":true,"fork":false,"pushed_at":"2019-12-24T03:56:39.000Z","size":313,"stargazers_count":349,"open_issues_count":11,"forks_count":67,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-11-04T17:47:40.286Z","etag":null,"topics":["ctc","deep-learning","ocr","pytorch","text-detection","text-detection-recognition","text-recognition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Megvii-CSG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-28T01:09:23.000Z","updated_at":"2024-09-11T06:21:25.000Z","dependencies_parsed_at":"2022-08-18T07:21:11.837Z","dependency_job_id":null,"html_url":"https://github.com/Megvii-CSG/MegReader","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/Megvii-CSG%2FMegReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megvii-CSG%2FMegReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megvii-CSG%2FMegReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megvii-CSG%2FMegReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Megvii-CSG","download_url":"https://codeload.github.com/Megvii-CSG/MegReader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083054,"owners_count":20880765,"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":["ctc","deep-learning","ocr","pytorch","text-detection","text-detection-recognition","text-recognition"],"created_at":"2024-08-01T13:01:32.305Z","updated_at":"2025-04-03T21:30:57.165Z","avatar_url":"https://github.com/Megvii-CSG.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# MegReader\nA project for research in text detection and recognition using PyTorch 1.2.\n\nThis project is originated from the research repo, which heavily relies on closed-source libraries, of CSG-Algorithm team of Megvii(https://megvii.com).\nWe are in ongoing progress to transfer models into this repo gradually, released implementations are listed in [Progress](#progress).\n\n## Highlights\n\n- Implementations of representative text detection and recognition methods.\n- An effective framework for conducting experiments: We use yaml files to configure experiments, making it convenient to take experiments.\n- Thorough logging features which make it easy to follow and analyze experimental results.\n- CPU/GPU compatible for training and inference.\n- Distributed training support.\n\n## Install\n\n### Requirements\n\n`pip install -r requirements.txt`\n\n- Python3.7\n- PyTorch 1.2 and CUDA 10.0.\n- gcc 5.5(Important for compiling)\n\n### Compile cuda ops (If needed)\n```\ncd PATH_TO_OPS\n\npython setup.py build_ext --inplace\n```\nops may be used:\n- DeformableConvV2 `assets/ops/dcn`\n- CTC2DLoss `ops/ctc_2d`\n\n### Configuration(optional)\n\nEdit configurations in `config.py`.\n\n## Training\n\nSee detailed options: `python3 train.py --help`\n\n## Datasets\nWe provide data loading implementation with annotation packed with json for quick start. \nAlso, lmdb format data are now available too.\nYou can refer the usage in [demo](experiments/recognition/crnn-lmdb.yaml).\nDatasets used in our recognition experiments can be downloaded from [onedrive](https://megvii-my.sharepoint.cn/:f:/g/personal/wanzhaoyi_megvii_com/EjkcrpmiW6hJrUKY-0fEBRABvNMtYniUPfWLVptMmy9-6w?e=bJaYFo). The transform [script](scripts/json_to_lmdb.py) are provide to convert json format data to lmdb.\n\n### Non-distributed\n\n`python3 train.py PATH_TO_EXPERIMENT.yaml --validate --visualize --name NAME_OF_EXPERIMENT`\n\nFollowing we provide some of configurations of the released recognition models:\n\n- CRNN: `experiments/recognition/crnn.yaml`\n- 2D CTC: `experiments/recognition/res50-ppm-2d-ctc.yaml`\n- Attention Decoder: `experiments/recognition/fpn50-attention-decoder.yaml`\n\n### Distributed(recommended for multi-gpu training)\n\n`python3 -m torch.distributed.launch --nproc_per_node=NUM_GPUS train.py PATH_TO_EXPERIMENT.yaml -d --validate`\n\n\u003c!--\n### Setup your own dataset\n--\u003e\n\n\n## Evaluating\n\nSee detailed options: `python3 eval.py --help`.\n\nKeeping ratio tesing is recommended: `python3 eval.py PATH_TO_EXPERIMENT.yaml --resize_mode keep_ratio`\n\n\n### Model zoo\nTrained models are comming soon.\n\u003c!--\nOur trained model can be downloaded from xxx.\n--\u003e\n\n## Progress\n### Recognition Methods\n- [x] 2D CTC\n- [x] CRNN\n- [x] Attention Decoder\n- [ ] Rectification\n\n### Detection Methods\n- [x] Text Snake\n- [x] EAST\n\n### End-to-end\n- [ ] Mask Text Spotter\n\n## Contributing\n\n[Contributing.md](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMegvii-CSG%2FMegReader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMegvii-CSG%2FMegReader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMegvii-CSG%2FMegReader/lists"}