- run
python genImg.py
to generate the train images intrain/
, validation set intest/
and the file name shall has the format of00000001_name.png
, the number of process is set to16
. cd standard
orcd warpCTC
- run
python lstm_ocr.py
to training
Notice that,
- standard : use
tf.nn.ctc_loss
to calculate the ctc loss - warpCTC : please install the warpCTC tensorflow_binding first
- python 3
- tensorflow 1.0.1
- captcha
- (optional) warpCTC tensorflow_binding
Notice that, Some tools and parameters can be found in utils_*.py
if you want use your training data, the height of the image shall be the same, and the suffix of the image shall be png
or you can modify the code in utils_*.py
fromtf.image.decode_png
to anything you need
After adding more training data
The accurary can be more than 95%
Read this blog for more detail