Skip to content

this project implements text area detection and OCR

Notifications You must be signed in to change notification settings

alchemy-studio/OCR-tf2

 
 

Repository files navigation

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

About

this project implements text area detection and OCR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%