A pure pytorch implemented ocr project.
Still under developing!
Test codes and training codes for CTPN are available now, training codes for CRNN will come soon.
- python-3.5+
- pytorch-0.4.1+
- torchvision-0.2.1
- opencv-3.4.0.14
- numpy-1.14.3
They 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
Detection is based on CTPN, some codes are borrowed from
pytorch_ctpn, several detection results:
Recognition is based on CRNN, some codes are borrowed from crnn.pytorch
Download pretrained models from here (extract code: u2ff) and put these files into checkpoints. Then run
python3 demo.py
The 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]
Training codes are placed into train_code directory.
Train CTPN
Train CRNN