You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will use **DBNet** model and **ICDAR2015** dataset for illustration, although other models and datasets are also supported. <!--ICDAR15 is a commonly-used model and a benchmark for scene text recognition.-->
69
-
70
-
#### 1. Data Preparation
71
-
72
-
Please download the ICDAR2015 dataset from this [website](https://rrc.cvc.uab.es/?ch=4&com=downloads), then format the dataset annotation refer to [dataset_convert](tools/dataset_converters/README.md).
73
-
74
-
After preparation, the data structure should be like
75
-
76
-
```text
77
-
.
78
-
├── test
79
-
│ ├── images
80
-
│ │ ├── img_1.jpg
81
-
│ │ ├── img_2.jpg
82
-
│ │ └── ...
83
-
│ └── det_gt.txt
84
-
└── train
85
-
├── images
86
-
│ ├── img_1.jpg
87
-
│ ├── img_2.jpg
88
-
│ └── ....jpg
89
-
└── det_gt.txt
90
-
```
91
-
92
-
#### 2. Configure Yaml
93
-
94
-
Please choose a yaml config file containing the target pre-defined model and data pipeline that you want to re-use from `configs/det`. Here we choose `configs/det/dbnet/db_r50_icdar15.yaml`.
95
-
96
-
And change the data config args according to
97
-
```yaml
98
-
train:
99
-
dataset:
100
-
data_dir: PATH/TO/TRAIN_IMAGES_DIR
101
-
label_file: PATH/TO/TRAIN_LABELS.txt
102
-
eval:
103
-
dataset:
104
-
data_dir: PATH/TO/TEST_IMAGES_DIR
105
-
label_file: PATH/TO/TEST_LABELS.txt
106
-
```
107
-
108
-
Optionally, change `num_workers` according to the cores of CPU, and change `distribute` to True if you are to train in distributed mode.
We will use **DBNet** model and **ICDAR2015** dataset for demonstration, although other models and datasets are also supported. Please refer to [DBNet model README](configs/det/dbnet/README.md).
128
69
129
70
130
71
### Text Recognition Model Training
131
72
132
-
We will use **CRNN** model and **LMDB** dataset for illustration, although other models and datasets are also supported.
133
-
134
-
#### 1. Data Preparation
135
-
136
-
Please download the LMDB dataset from [here](https://www.dropbox.com/sh/i39abvnefllx2si/AAAbAYRvxzRp3cIE5HzqUw3ra?dl=0) (ref: [deep-text-recognition-benchmark](https://github.com/clovaai/deep-text-recognition-benchmark#download-lmdb-dataset-for-traininig-and-evaluation-from-here)).
137
-
138
-
There're several .zip data files:
139
-
- `data_lmdb_release.zip`contains the entire datasets including train, valid and evaluation.
140
-
- `validation.zip`is the union dataset for Validation
141
-
- `evaluation.zip`contains several benchmarking datasets.
142
-
143
-
Unzip the data and after preparation, the data structure should be like
144
-
145
-
``` text
146
-
.
147
-
├── train
148
-
│ ├── MJ
149
-
│ │ ├── data.mdb
150
-
│ │ ├── lock.mdb
151
-
│ ├── ST
152
-
│ │ ├── data.mdb
153
-
│ │ ├── lock.mdb
154
-
└── validation
155
-
| ├── data.mdb
156
-
| ├── lock.mdb
157
-
└── evaluation
158
-
├── IC03
159
-
│ ├── data.mdb
160
-
│ ├── lock.mdb
161
-
├── IC13
162
-
│ ├── data.mdb
163
-
│ ├── lock.mdb
164
-
└── ...
165
-
```
166
-
167
-
#### 2. Configure Yaml
168
-
169
-
Please choose a yaml config file containing the target pre-defined model and data pipeline that you want to re-use from `configs/rec`. Here we choose `configs/rec/crnn/crnn_resnet34.yaml`.
73
+
We will use **CRNN** model and **LMDB** dataset for demonstration, although other models and datasets are also supported. Please refer to [CRNN model README](configs/rec/crnn/README.md).
170
74
171
-
Please change the data config args accordingly, such as
172
-
``` yaml
173
-
train:
174
-
dataset:
175
-
type: LMDBDataset
176
-
data_dir: lmdb_data/rec/train/
177
-
eval:
178
-
dataset:
179
-
type: LMDBDataset
180
-
data_dir: lmdb_data/rec/validation/
181
-
```
182
-
183
-
Optionally, change `num_workers` according to the cores of CPU, and change `distribute` to True if you are to train in distributed mode.
184
-
185
-
#### 3. Training
186
-
187
-
We will use distributed training for the large LMDB dataset.
0 commit comments