@@ -76,13 +76,13 @@ tar xf attention_ocr_2017_05_17.tar.gz
76
76
python train.py --checkpoint=model.ckpt-399731
77
77
```
78
78
79
- ## How to use your own image data to train the Model?
79
+ ## How to use your own image data to train the model
80
80
81
81
You need to define a new dataset. There are two options:
82
82
83
83
1 . Store data in the same format as the FSNS dataset and just reuse the
84
84
[ python/datasets/fsns.py] ( https://github.com/tensorflow/models/blob/master/attention_ocr/python/datasets/fsns.py )
85
- module. E.g. create a file datasets/newtextdataset.py
85
+ module. E.g., create a file datasets/newtextdataset.py:
86
86
```
87
87
import fsns
88
88
@@ -140,22 +140,22 @@ dataset name in the command line.
140
140
python train.py --dataset_name=newtextdataset
141
141
```
142
142
143
- Please note the eval.py will also require the same flag.
143
+ Please note that eval.py will also require the same flag.
144
144
145
145
2 . Define a new dataset format. The model needs the following data to train:
146
146
147
147
- images: input images, shape [ batch_size x H x W x 3] ;
148
148
- labels: ground truth label ids, shape=[ batch_size x seq_length] ;
149
149
- labels_one_hot: labels in one-hot encoding, shape [ batch_size x seq_length x num_char_classes] ;
150
150
151
- Refer to the [ python/data_provider.py] ( https://github.com/tensorflow/models/blob/master/attention_ocr/python/data_provider.py#L33 )
152
- for more details. You can use the [ python/datasets/fsns.py] ( https://github.com/tensorflow/models/blob/master/attention_ocr/python/datasets/fsns.py )
151
+ Refer to [ python/data_provider.py] ( https://github.com/tensorflow/models/blob/master/attention_ocr/python/data_provider.py#L33 )
152
+ for more details. You can use [ python/datasets/fsns.py] ( https://github.com/tensorflow/models/blob/master/attention_ocr/python/datasets/fsns.py )
153
153
as the example.
154
154
155
155
## How to use a pre-trained model
156
156
157
157
The inference part was not released yet, but it is pretty straightforward to
158
- implement one in python or C++.
158
+ implement one in Python or C++.
159
159
160
160
The recommended way is to use the [ Serving infrastructure] ( https://tensorflow.github.io/serving/serving_basic ) .
161
161
0 commit comments