mmocr.yml 14.6 KB
Newer Older
limm's avatar
limm committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
globals:
  repo_url: https://github.com/open-mmlab/mmocr/tree/main
  codebase_dir: ../mmocr
  checkpoint_force_download: False
  images:
    img_densetext_det: &img_densetext_det ../mmocr/demo/demo_densetext_det.jpg
    img_demo_text_det: &img_demo_text_det ../mmocr/demo/demo_text_det.jpg
    img_demo_text_recog: &img_demo_text_recog ../mmocr/demo/demo_text_recog.jpg
  metric_info: &metric_info
    hmean-iou: # named after metafile.Results.Metrics
      metric_key: icdar/hmean # eval key name
      tolerance: 0.15 # metric ±n%
    IIIT5K word_acc:
      metric_key: IIIT5K/recog/word_acc_ignore_case_symbol
      tolerance: 0.05 # metric ±n%
      dataset: IIIT5K
    SVT word_acc:
      metric_key: SVT/recog/word_acc_ignore_case_symbol
      tolerance: 0.05 # metric ±n%
      dataset: SVT
    SVTP word_acc:
      metric_key: SVTP/recog/word_acc_ignore_case_symbol
      tolerance: 0.05 # metric ±n%
      dataset: SVTP
  convert_image_det: &convert_image_det
    input_img: *img_densetext_det
    test_img: *img_demo_text_det
  convert_image_rec: &convert_image_rec
    input_img: *img_demo_text_recog
    test_img: *img_demo_text_recog
  backend_test: &default_backend_test True
  sdk:
    sdk_detection_dynamic: &sdk_detection_dynamic configs/mmocr/text-detection/text-detection_sdk_dynamic.py
    sdk_recognition_dynamic: &sdk_recognition_dynamic configs/mmocr/text-recognition/text-recognition_sdk_dynamic.py

onnxruntime:
  # ======= detection =======
  pipeline_ort_detection_static_fp32: &pipeline_ort_detection_static_fp32
    convert_image: *convert_image_det
    deploy_config: configs/mmocr/text-detection/text-detection_onnxruntime_static.py

  pipeline_ort_detection_dynamic_fp32: &pipeline_ort_detection_dynamic_fp32
    convert_image: *convert_image_det
    deploy_config: configs/mmocr/text-detection/text-detection_onnxruntime_dynamic.py

  pipeline_ort_detection_dynamic_fp16: &pipeline_ort_detection_dynamic_fp16
    convert_image: *convert_image_det
    deploy_config: configs/mmocr/text-detection/text-detection_onnxruntime-fp16_dynamic.py

  pipeline_ort_detection_mrcnn_dynamic_fp32: &pipeline_ort_detection_mrcnn_dynamic_fp32
    convert_image: *convert_image_det
    deploy_config: configs/mmocr/text-detection/text-detection_mrcnn_onnxruntime_dynamic.py

  # ======= recognition =======
  pipeline_ort_recognition_static_fp32: &pipeline_ort_recognition_static_fp32
    convert_image: *convert_image_rec
    deploy_config: configs/mmocr/text-recognition/text-recognition_onnxruntime_static.py

  pipeline_ort_recognition_dynamic_fp32: &pipeline_ort_recognition_dynamic_fp32
    convert_image: *convert_image_rec
    deploy_config: configs/mmocr/text-recognition/text-recognition_onnxruntime_dynamic.py

  pipeline_ort_recognition_dynamic_fp16: &pipeline_ort_recognition_dynamic_fp16
    convert_image: *convert_image_rec
    deploy_config: configs/mmocr/text-recognition/text-recognition_onnxruntime-fp16_dynamic.py


tensorrt:
  # ======= detection =======
  pipeline_trt_detection_static_fp32: &pipeline_trt_detection_static_fp32
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt_static-512x512.py

  pipeline_trt_detection_static_fp16: &pipeline_trt_detection_static_fp16
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt-fp16_static-512x512.py

  pipeline_trt_detection_static_int8: &pipeline_trt_detection_static_int8
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt-int8_static-512x512.py

  pipeline_trt_detection_dynamic_fp32: &pipeline_trt_detection_dynamic_fp32
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt_dynamic-320x320-2240x2240.py

  pipeline_trt_detection_mrcnn_dynamic_fp32: &pipeline_trt_detection_mrcnn_dynamic_fp32
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_mrcnn_tensorrt_dynamic-320x320-2240x2240.py

  pipeline_trt_detection_dynamic_fp16: &pipeline_trt_detection_dynamic_fp16
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt-fp16_dynamic-320x320-2240x2240.py

  pipeline_trt_detection_mrcnn_dynamic_fp16: &pipeline_trt_detection_mrcnn_dynamic_fp16
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_mrcnn_tensorrt-fp16_dynamic-320x320-2240x2240.py

  pipeline_trt_detection_dynamic_int8: &pipeline_trt_detection_dynamic_int8
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    sdk_config: *sdk_detection_dynamic
    deploy_config: configs/mmocr/text-detection/text-detection_tensorrt-int8_dynamic-320x320-2240x2240.py

  # ======= recognition =======
  pipeline_trt_recognition_static_fp32_C1: &pipeline_trt_recognition_static_fp32_C1
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt_static-1x32x32.py

  # ABINet models with static shape 32x128
  pipeline_trt_recognition_static_fp32_C3: &pipeline_trt_recognition_static_fp32_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt_static-32x128.py

  pipeline_trt_recognition_static_fp16_C3: &pipeline_trt_recognition_static_fp16_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-fp16_static-32x128.py

  # SAR models with height 48 and channel 3
  pipeline_trt_recognition_dynamic_fp32_H48_C3: &pipeline_trt_recognition_dynamic_fp32_H48_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt_dynamic-48x64-48x640.py

  pipeline_trt_recognition_dynamic_fp16_H48_C3: &pipeline_trt_recognition_dynamic_fp16_H48_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-fp16_dynamic-48x64-48x640.py

  pipeline_trt_recognition_dynamic_int8_H48_C3: &pipeline_trt_recognition_dynamic_int8_H48_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-int8_dynamic-48x64-48x640.py

  # CRNN models with height 32 and channel 1
  pipeline_trt_recognition_dynamic_fp32_H32_C1: &pipeline_trt_recognition_dynamic_fp32_H32_C1
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt_dynamic-1x32x32-1x32x640.py

  pipeline_trt_recognition_dynamic_fp16_H32_C1: &pipeline_trt_recognition_dynamic_fp16_H32_C1
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-fp16_dynamic-1x32x32-1x32x640.py

  pipeline_trt_recognition_dynamic_int8_H32_C1: &pipeline_trt_recognition_dynamic_int8_H32_C1
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-int8_dynamic-1x32x32-1x32x640.py

  # SATRN models with height 32 and channel 3
  pipeline_trt_recognition_dynamic_fp32_H32_C3: &pipeline_trt_recognition_dynamic_fp32_H32_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt_dynamic-32x32-32x640.py

  pipeline_trt_recognition_dynamic_fp16_H32_C3: &pipeline_trt_recognition_dynamic_fp16_H32_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-fp16_dynamic-32x32-32x640.py

  pipeline_trt_recognition_dynamic_int8_H32_C3: &pipeline_trt_recognition_dynamic_int8_H32_C3
    convert_image: *convert_image_rec
    backend_test: *default_backend_test
    sdk_config: *sdk_recognition_dynamic
    deploy_config: configs/mmocr/text-recognition/text-recognition_tensorrt-int8_dynamic-32x32-32x640.py

openvino:
  pipeline_openvino_detection_dynamic_fp32: &pipeline_openvino_detection_dynamic_fp32
    convert_image: *convert_image_det
    backend_test: *default_backend_test
    deploy_config: configs/mmocr/text-detection/text-detection_openvino_dynamic-640x640.py

#  pipeline_openvino_recognition_dynamic_fp32: &pipeline_openvino_recognition_dynamic_fp32
#    convert_image: *convert_image_rec
#    backend_test: *default_backend_test
#    deploy_config:

ncnn:
  pipeline_ncnn_detection_static_fp32: &pipeline_ncnn_detection_static_fp32
    convert_image: *convert_image_det
    backend_test: False
    deploy_config: configs/mmocr/text-detection/text-detection_ncnn_static.py

  pipeline_ncnn_recognition_static_fp32: &pipeline_ncnn_recognition_static_fp32
    convert_image: *convert_image_rec
    backend_test: False
    deploy_config: configs/mmocr/text-recognition/text-recognition_ncnn_static.py

pplnn:
  pipeline_pplnn_detection_dynamic_fp32: &pipeline_pplnn_detection_dynamic_fp32
    convert_image: *convert_image_det
    backend_test: False
    deploy_config: configs/mmocr/text-detection/text-detection_pplnn_dynamic-640x640.py

  pipeline_pplnn_recognition_dynamic_fp32: &pipeline_pplnn_recognition_dynamic_fp32
    convert_image: *convert_image_rec
    backend_test: False
    deploy_config: configs/mmocr/text-recognition/text-recognition_pplnn_dynamic-1x32x32.py

torchscript:
  pipeline_ts_detection_fp32: &pipeline_ts_detection_fp32
    convert_image: *convert_image_det
    backend_test: False
    deploy_config: configs/mmocr/text-detection/text-detection_torchscript.py

  pipeline_ts_detection_mrcnn_fp32: &pipeline_ts_detection_mrcnn_fp32
    convert_image: *convert_image_det
    backend_test: False
    deploy_config: configs/mmocr/text-detection/text-detection_mrcnn_torchscript.py

  pipeline_ts_recognition_fp32: &pipeline_ts_recognition_fp32
    convert_image: *convert_image_rec
    backend_test: False
    deploy_config: configs/mmocr/text-recognition/text-recognition_torchscript.py


models:
  - name: DBNet
    metafile: configs/textdet/dbnet/metafile.yml
    model_configs:
      - configs/textdet/dbnet/dbnet_resnet18_fpnc_1200e_icdar2015.py
    pipelines:
      - *pipeline_ts_detection_fp32
      - *pipeline_ort_detection_dynamic_fp32
      - *pipeline_trt_detection_dynamic_fp16
      - *pipeline_ncnn_detection_static_fp32
      - *pipeline_pplnn_detection_dynamic_fp32
      - *pipeline_openvino_detection_dynamic_fp32

  - name: DBNetpp
    metafile: configs/textdet/dbnetpp/metafile.yml
    model_configs:
      - configs/textdet/dbnetpp/dbnetpp_resnet50_fpnc_1200e_icdar2015.py
    pipelines:
      - *pipeline_ort_detection_dynamic_fp32
      - *pipeline_trt_detection_dynamic_fp16
      - *pipeline_ncnn_detection_static_fp32
      - *pipeline_openvino_detection_dynamic_fp32

  - name: PANet
    metafile: configs/textdet/panet/metafile.yml
    model_configs:
      - configs/textdet/panet/panet_resnet18_fpem-ffm_600e_icdar2015.py
    pipelines:
      - *pipeline_ts_detection_fp32
      - *pipeline_ort_detection_dynamic_fp32
      - *pipeline_trt_detection_dynamic_fp16
      - *pipeline_ncnn_detection_static_fp32
      - *pipeline_pplnn_detection_dynamic_fp32
      - *pipeline_openvino_detection_dynamic_fp32

  - name: PSENet
    metafile: configs/textdet/psenet/metafile.yml
    model_configs:
      - configs/textdet/psenet/psenet_resnet50_fpnf_600e_icdar2015.py
    pipelines:
      - *pipeline_ts_detection_fp32
      - *pipeline_ort_detection_dynamic_fp32
      - *pipeline_trt_detection_dynamic_fp16
      - *pipeline_ncnn_detection_static_fp32
      - *pipeline_pplnn_detection_dynamic_fp32
      - *pipeline_openvino_detection_dynamic_fp32

  - name: TextSnake
    metafile: configs/textdet/textsnake/metafile.yml
    model_configs:
      - configs/textdet/textsnake/textsnake_resnet50_fpn-unet_1200e_ctw1500.py
    pipelines:
      - *pipeline_ts_detection_fp32
      - *pipeline_ort_detection_dynamic_fp32
      - *pipeline_trt_detection_dynamic_fp32

  - name: MaskRCNN
    metafile: configs/textdet/maskrcnn/metafile.yml
    model_configs:
      - configs/textdet/maskrcnn/mask-rcnn_resnet50_fpn_160e_icdar2015.py
    pipelines:
      - *pipeline_ts_detection_mrcnn_fp32
      - *pipeline_ort_detection_mrcnn_dynamic_fp32
      - *pipeline_trt_detection_mrcnn_dynamic_fp32

  - name: CRNN
    metafile: configs/textrecog/crnn/metafile.yml
    model_configs:
      - configs/textrecog/crnn/crnn_mini-vgg_5e_mj.py
    pipelines:
      - *pipeline_ts_recognition_fp32
      - *pipeline_ort_recognition_dynamic_fp32
      - *pipeline_trt_recognition_dynamic_fp16_H32_C1
      - *pipeline_ncnn_recognition_static_fp32
      - *pipeline_pplnn_recognition_dynamic_fp32

  - name: SAR
    metafile: configs/textrecog/sar/metafile.yml
    model_configs:
      - configs/textrecog/sar/sar_resnet31_parallel-decoder_5e_st-sub_mj-sub_sa_real.py
    pipelines:
      - *pipeline_ts_recognition_fp32
      - *pipeline_ort_recognition_dynamic_fp32

  - name: SATRN
    metafile: configs/textrecog/satrn/metafile.yml
    model_configs:
      - configs/textrecog/satrn/satrn_shallow-small_5e_st_mj.py
    pipelines:
      - *pipeline_ts_recognition_fp32
      - *pipeline_ort_recognition_dynamic_fp32
      - *pipeline_trt_recognition_dynamic_fp32_H32_C3

  - name: ABINet
    metafile: configs/textrecog/abinet/metafile.yml
    model_configs:
      - configs/textrecog/abinet/abinet_20e_st-an_mj.py
    pipelines:
      - *pipeline_ts_recognition_fp32
      - *pipeline_ort_recognition_static_fp32
      - *pipeline_trt_recognition_static_fp16_C3