- master:
- harder to converge compare to the beta version
- both standard ctc and warpCTC
- read data at once
- dev:
- the pipline version of lstm_ctc_ocr, resize to same size
- beta:
- generate data on the fly
- deal with multi-width image, padding to same width
- 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
- warpCTC tensorflow_binding
Notice that,
parameters can be found in ./lstm.yml
(higher priority) and lib/lstm/utils/config.y
some parameters need to be fined tune:
- learning rate
- decay step & decay rate
- image_height
- optimizer?
in ./lib/lstm/utils/gen.py
, the height of the images are the same, and I pad the width
to the same for each batch, so
if you want to use your own data, the height of the image shall be the same.
The accurary can be more that 95%
Read this blog for more details and this blog for how to
use tf.nn.ctc_loss
or warpCTC