det_res18_db_v2.0.yml 3.1 KB

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