Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 1.85 KB

README.md

File metadata and controls

74 lines (53 loc) · 1.85 KB

OCR-tf2

this project implements text area detection and OCR

download the dataset for text area detection

download the dataset prepared by the author of the paper "Detecting Text in Natural Image with Connectionist Text Proposal Network" here

create dataset for text area detection

create with the following command

python3 create_dataset.py <path/to/mlt directory>

train the text area detector

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 text area detector

test the detector with

python3 TextDetector.py <path/to/the/picture>

text area detection results

here are some results of my model which is enclosed at model/ctpn.h5 .

Loss
train loss

Detection results

train the ocr

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