ch_det_res18_db_v2.0.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Global:
  2. use_gpu: true
  3. epoch_num: 1200
  4. log_smooth_window: 20
  5. print_batch_step: 2
  6. save_model_dir: ./output/ch_db_res18/
  7. save_epoch_step: 1200
  8. # evaluation is run every 5000 iterations after the 4000th iteration
  9. eval_batch_step: [3000, 2000]
  10. # if pretrained_model is saved in static mode, load_static_weights must set to True
  11. load_static_weights: True
  12. cal_metric_during_train: False
  13. pretrained_model: ./pretrain_models/ResNet18_vd_pretrained
  14. checkpoints:
  15. save_inference_dir:
  16. use_visualdl: False
  17. infer_img: doc/imgs_en/img_10.jpg
  18. save_res_path: ./output/det_db/predicts_db.txt
  19. Architecture:
  20. model_type: det
  21. algorithm: DB
  22. Transform:
  23. Backbone:
  24. name: ResNet
  25. layers: 18
  26. disable_se: True
  27. Neck:
  28. name: DBFPN
  29. out_channels: 256
  30. Head:
  31. name: DBHead
  32. k: 50
  33. Loss:
  34. name: DBLoss
  35. balance_loss: true
  36. main_loss_type: DiceLoss
  37. alpha: 5
  38. beta: 10
  39. ohem_ratio: 3
  40. Optimizer:
  41. name: Adam
  42. beta1: 0.9
  43. beta2: 0.999
  44. lr:
  45. name: Cosine
  46. learning_rate: 0.001
  47. warmup_epoch: 2
  48. regularizer:
  49. name: 'L2'
  50. factor: 0
  51. PostProcess:
  52. name: DBPostProcess
  53. thresh: 0.3
  54. box_thresh: 0.6
  55. max_candidates: 1000
  56. unclip_ratio: 1.5
  57. Metric:
  58. name: DetMetric
  59. main_indicator: hmean
  60. Train:
  61. dataset:
  62. name: SimpleDataSet
  63. data_dir: ./train_data/icdar2015/text_localization/
  64. label_file_list:
  65. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  66. ratio_list: [1.0]
  67. transforms:
  68. - DecodeImage: # load image
  69. img_mode: BGR
  70. channel_first: False
  71. - DetLabelEncode: # Class handling label
  72. - IaaAugment:
  73. augmenter_args:
  74. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  75. - { 'type': Affine, 'args': { 'rotate': [-10, 10] } }
  76. - { 'type': Resize, 'args': { 'size': [0.5, 3] } }
  77. - EastRandomCropData:
  78. size: [960, 960]
  79. max_tries: 50
  80. keep_ratio: true
  81. - MakeBorderMap:
  82. shrink_ratio: 0.4
  83. thresh_min: 0.3
  84. thresh_max: 0.7
  85. - MakeShrinkMap:
  86. shrink_ratio: 0.4
  87. min_text_size: 8
  88. - NormalizeImage:
  89. scale: 1./255.
  90. mean: [0.485, 0.456, 0.406]
  91. std: [0.229, 0.224, 0.225]
  92. order: 'hwc'
  93. - ToCHWImage:
  94. - KeepKeys:
  95. keep_keys: ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] # the order of the dataloader list
  96. loader:
  97. shuffle: True
  98. drop_last: False
  99. batch_size_per_card: 8
  100. num_workers: 4
  101. Eval:
  102. dataset:
  103. name: SimpleDataSet
  104. data_dir: ./train_data/icdar2015/text_localization/
  105. label_file_list:
  106. - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
  107. transforms:
  108. - DecodeImage: # load image
  109. img_mode: BGR
  110. channel_first: False
  111. - DetLabelEncode: # Class handling label
  112. - DetResizeForTest:
  113. # image_shape: [736, 1280]
  114. - NormalizeImage:
  115. scale: 1./255.
  116. mean: [0.485, 0.456, 0.406]
  117. std: [0.229, 0.224, 0.225]
  118. order: 'hwc'
  119. - ToCHWImage:
  120. - KeepKeys:
  121. keep_keys: ['image', 'shape', 'polys', 'ignore_tags']
  122. loader:
  123. shuffle: False
  124. drop_last: False
  125. batch_size_per_card: 1 # must be 1
  126. num_workers: 2