det_r50_vd_db.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. Global:
  2. use_gpu: true
  3. epoch_num: 1200
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/det_r50_vd/
  7. save_epoch_step: 1200
  8. # evaluation is run every 2000 iterations
  9. eval_batch_step: [0,2000]
  10. cal_metric_during_train: False
  11. pretrained_model: ./pretrain_models/ResNet50_vd_ssld_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: 50
  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. learning_rate: 0.001
  43. regularizer:
  44. name: 'L2'
  45. factor: 0
  46. PostProcess:
  47. name: DBPostProcess
  48. thresh: 0.3
  49. box_thresh: 0.7
  50. max_candidates: 1000
  51. unclip_ratio: 1.5
  52. Metric:
  53. name: DetMetric
  54. main_indicator: hmean
  55. Train:
  56. dataset:
  57. name: SimpleDataSet
  58. data_dir: ./train_data/icdar2015/text_localization/
  59. label_file_list:
  60. - ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
  61. ratio_list: [1.0]
  62. transforms:
  63. - DecodeImage: # load image
  64. img_mode: BGR
  65. channel_first: False
  66. - DetLabelEncode: # Class handling label
  67. - IaaAugment:
  68. augmenter_args:
  69. - { 'type': Fliplr, 'args': { 'p': 0.5 } }
  70. - { 'type': Affine, 'args': { 'rotate': [-10, 10] } }
  71. - { 'type': Resize, 'args': { 'size': [0.5, 3] } }
  72. - EastRandomCropData:
  73. size: [640, 640]
  74. max_tries: 50
  75. keep_ratio: true
  76. - MakeBorderMap:
  77. shrink_ratio: 0.4
  78. thresh_min: 0.3
  79. thresh_max: 0.7
  80. - MakeShrinkMap:
  81. shrink_ratio: 0.4
  82. min_text_size: 8
  83. - NormalizeImage:
  84. scale: 1./255.
  85. mean: [0.485, 0.456, 0.406]
  86. std: [0.229, 0.224, 0.225]
  87. order: 'hwc'
  88. - ToCHWImage:
  89. - KeepKeys:
  90. keep_keys: ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] # the order of the dataloader list
  91. loader:
  92. shuffle: True
  93. drop_last: False
  94. batch_size_per_card: 16
  95. num_workers: 4
  96. Eval:
  97. dataset:
  98. name: SimpleDataSet
  99. data_dir: ./train_data/icdar2015/text_localization/
  100. label_file_list:
  101. - ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
  102. transforms:
  103. - DecodeImage: # load image
  104. img_mode: BGR
  105. channel_first: False
  106. - DetLabelEncode: # Class handling label
  107. - DetResizeForTest:
  108. image_shape: [736, 1280]
  109. - NormalizeImage:
  110. scale: 1./255.
  111. mean: [0.485, 0.456, 0.406]
  112. std: [0.229, 0.224, 0.225]
  113. order: 'hwc'
  114. - ToCHWImage:
  115. - KeepKeys:
  116. keep_keys: ['image', 'shape', 'polys', 'ignore_tags']
  117. loader:
  118. shuffle: False
  119. drop_last: False
  120. batch_size_per_card: 1 # must be 1
  121. num_workers: 8