this project implements text area detection and OCR
download the dataset prepared by the author of the paper "Detecting Text in Natural Image with Connectionist Text Proposal Network" here
create with the following command
python3 create_dataset.py <path/to/mlt directory>
train with the following command
python3 train.py ctpn
when the training process finishes, it will save the parameters in hdf5 format automatically. if you interrupt the training process, you can save the model with the following command
python3 save_model.py ctpn
test the detector with
python3 TextDetector.py <path/to/the/picture>
here are some results of my model which is enclosed at model/ctpn.h5 .
![]() |
![]() |
![]() |
![]() |
![]() |
the OCR part of the project is an implement of CRNN introduced in paper "An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition" . train the model with the following command
python3 train.py ocr
save the trained model with command
python3 save_model.py ocr