Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/courao/ocr.pytorch
A pure pytorch implemented ocr project including text detection and recognition
https://github.com/courao/ocr.pytorch
crnn ctpn ocr ocr-pytorch text-detection text-recognition
Last synced: 10 days ago
JSON representation
A pure pytorch implemented ocr project including text detection and recognition
- Host: GitHub
- URL: https://github.com/courao/ocr.pytorch
- Owner: courao
- License: mit
- Created: 2019-04-30T05:36:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-10T09:12:26.000Z (over 2 years ago)
- Last Synced: 2024-08-02T11:16:06.547Z (3 months ago)
- Topics: crnn, ctpn, ocr, ocr-pytorch, text-detection, text-recognition
- Language: Python
- Homepage:
- Size: 2.18 MB
- Stars: 572
- Watchers: 13
- Forks: 132
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ocr.pytorch
> A pure pytorch implemented ocr project.
Text detection is based CTPN and text recognition is based CRNN.
More detection and recognition methods will be supported!## Prerequisite
- python-3.5+
- pytorch-0.4.1+
- torchvision-0.2.1
- opencv-3.4.0.14
- numpy-1.14.3They could all be installed through pip except pytorch and torchvision. As for pytorch and torchvision,
they both depends on your CUDA version, you would prefer to reading [pytorch's official site](https://pytorch.org/)### Detection
Detection is based on [CTPN](https://arxiv.org/abs/1609.03605), some codes are borrowed from
[pytorch_ctpn](https://github.com/opconty/pytorch_ctpn), several detection results:
![detect1](test_result/t1.jpg)
![detect2](test_result/t2.jpg)
### Recognition
Recognition is based on [CRNN](http://arxiv.org/abs/1507.05717), some codes are borrowed from
[crnn.pytorch](https://github.com/meijieru/crnn.pytorch)### Test
Download pretrained models from [Baidu Netdisk](https://pan.baidu.com/s/1yllO9hBF8TgChHJ7i3WobA) (extract code: u2ff) or [Google Driver](https://drive.google.com/open?id=1hRr9v9ky4VGygToFjLD9Cd-9xan43qID)
and put these files into checkpoints.
Then run
>python3 demo.pyThe image files in ./test_images will be tested for text detection and recognition, the results will be stored in ./test_result.
If you want to test a single image, run
>python3 test_one.py [filename]### Train
Training codes are placed into train_code directory.
Train [CTPN](./train_code/train_ctpn/readme.md)
Train [CRNN](./train_code/train_crnn/readme.md)### Licence
[MIT License](https://opensource.org/licenses/MIT)