det_res18_db_v2.0.yml 3.1 KB

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