A TensorFlow model for image text extraction problems.
Forked from https://github.com/tensorflow/models/tree/master/research/attention_ocr
-
Install the TensorFlow library.
-
Data. For example,
datasets +-- data | +-- fsns | +-- charset_size=134.txt | +-- fsns-00000-of-00001 +-- fsns.py
To train from scratch:
python train.py \
--train_log_dir=train_logsTo train a model using pre-trained Inception weights as initialization:
python train.py \
--checkpoint_inception=inception_v3.ckptTo fine tune the Attention OCR model using a checkpoint:
python train.py \
--checkpoint=model.ckpt-399731python eval.py \
--train_log_dir=train_logs \
--eval_log_dir=eval_logs \
--num_batches=1python infer.py \
--checkpoint=model.ckpt-399731 \
--image_path_pattern=datasets/data/fsns/testdata/fsns_train_%02d.png