hrnet_w32_256x256_mpii.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. use_gpu: true
  2. log_iter: 5
  3. save_dir: output
  4. snapshot_epoch: 10
  5. weights: output/hrnet_w32_256x256_mpii/model_final
  6. epoch: 210
  7. num_joints: &num_joints 16
  8. pixel_std: &pixel_std 200
  9. metric: KeyPointTopDownMPIIEval
  10. num_classes: 1
  11. train_height: &train_height 256
  12. train_width: &train_width 256
  13. trainsize: &trainsize [*train_width, *train_height]
  14. hmsize: &hmsize [64, 64]
  15. flip_perm: &flip_perm [[0, 5], [1, 4], [2, 3], [10, 15], [11, 14], [12, 13]]
  16. #####model
  17. architecture: TopDownHRNet
  18. pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/Trunc_HRNet_W32_C_pretrained.pdparams
  19. TopDownHRNet:
  20. backbone: HRNet
  21. post_process: HRNetPostProcess
  22. flip_perm: *flip_perm
  23. num_joints: *num_joints
  24. width: &width 32
  25. loss: KeyPointMSELoss
  26. HRNet:
  27. width: *width
  28. freeze_at: -1
  29. freeze_norm: false
  30. return_idx: [0]
  31. KeyPointMSELoss:
  32. use_target_weight: true
  33. #####optimizer
  34. LearningRate:
  35. base_lr: 0.0005
  36. schedulers:
  37. - !PiecewiseDecay
  38. milestones: [170, 200]
  39. gamma: 0.1
  40. - !LinearWarmup
  41. start_factor: 0.001
  42. steps: 1000
  43. OptimizerBuilder:
  44. optimizer:
  45. type: Adam
  46. regularizer:
  47. factor: 0.0
  48. type: L2
  49. #####data
  50. TrainDataset:
  51. !KeypointTopDownMPIIDataset
  52. image_dir: images
  53. anno_path: annotations/mpii_train.json
  54. dataset_dir: dataset/mpii
  55. num_joints: *num_joints
  56. EvalDataset:
  57. !KeypointTopDownMPIIDataset
  58. image_dir: images
  59. anno_path: annotations/mpii_val.json
  60. dataset_dir: dataset/mpii
  61. num_joints: *num_joints
  62. TestDataset:
  63. !ImageFolder
  64. anno_path: dataset/coco/keypoint_imagelist.txt
  65. worker_num: 4
  66. global_mean: &global_mean [0.485, 0.456, 0.406]
  67. global_std: &global_std [0.229, 0.224, 0.225]
  68. TrainReader:
  69. sample_transforms:
  70. - RandomFlipHalfBodyTransform:
  71. scale: 0.5
  72. rot: 40
  73. num_joints_half_body: 8
  74. prob_half_body: 0.3
  75. pixel_std: *pixel_std
  76. trainsize: *trainsize
  77. upper_body_ids: [7, 8, 9, 10, 11, 12, 13, 14, 15]
  78. flip_pairs: *flip_perm
  79. - TopDownAffine:
  80. trainsize: *trainsize
  81. - ToHeatmapsTopDown:
  82. hmsize: *hmsize
  83. sigma: 2
  84. batch_transforms:
  85. - NormalizeImage:
  86. mean: *global_mean
  87. std: *global_std
  88. is_scale: true
  89. - Permute: {}
  90. batch_size: 64
  91. shuffle: true
  92. drop_last: false
  93. EvalReader:
  94. sample_transforms:
  95. - TopDownAffine:
  96. trainsize: *trainsize
  97. batch_transforms:
  98. - NormalizeImage:
  99. mean: *global_mean
  100. std: *global_std
  101. is_scale: true
  102. - Permute: {}
  103. batch_size: 16
  104. TestReader:
  105. inputs_def:
  106. image_shape: [3, *train_height, *train_width]
  107. sample_transforms:
  108. - Decode: {}
  109. - TopDownEvalAffine:
  110. trainsize: *trainsize
  111. - NormalizeImage:
  112. mean: *global_mean
  113. std: *global_std
  114. is_scale: true
  115. - Permute: {}
  116. batch_size: 1