YOLOX-X.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. use_gpu: true
  2. use_xpu: false
  3. use_mlu: false
  4. use_npu: false
  5. use_ema: True
  6. log_iter: 100
  7. save_dir: output
  8. snapshot_epoch: 10
  9. print_flops: false
  10. print_params: false
  11. metric: COCO
  12. num_classes: 80
  13. TrainDataset:
  14. name: COCODataSet
  15. image_dir: train2017
  16. anno_path: annotations/instances_train2017.json
  17. dataset_dir: dataset/coco
  18. data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
  19. EvalDataset:
  20. name: COCODataSet
  21. image_dir: val2017
  22. anno_path: annotations/instances_val2017.json
  23. dataset_dir: dataset/coco
  24. allow_empty: true
  25. TestDataset:
  26. name: ImageFolder
  27. anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
  28. dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
  29. worker_num: 4
  30. TrainReader:
  31. sample_transforms:
  32. - Decode: {}
  33. - Mosaic:
  34. prob: 1.0
  35. input_dim: [640, 640]
  36. degrees: [-10, 10]
  37. scale: [0.1, 2.0]
  38. shear: [-2, 2]
  39. translate: [-0.1, 0.1]
  40. enable_mixup: True
  41. mixup_prob: 1.0
  42. mixup_scale: [0.5, 1.5]
  43. - AugmentHSV: {is_bgr: False, hgain: 5, sgain: 30, vgain: 30}
  44. - PadResize: {target_size: 640}
  45. - RandomFlip: {}
  46. batch_transforms:
  47. - Permute: {}
  48. batch_size: 8
  49. shuffle: True
  50. drop_last: True
  51. collate_batch: False
  52. mosaic_epoch: 285
  53. EvalReader:
  54. sample_transforms:
  55. - Decode: {}
  56. - Resize: {target_size: [640, 640], keep_ratio: True, interp: 1}
  57. - Pad: {size: [640, 640], fill_value: [114., 114., 114.]}
  58. - Permute: {}
  59. batch_size: 4
  60. TestReader:
  61. inputs_def:
  62. image_shape: [3, 640, 640]
  63. sample_transforms:
  64. - Decode: {}
  65. - Resize: {target_size: [640, 640], keep_ratio: True, interp: 1}
  66. - Pad: {size: [640, 640], fill_value: [114., 114., 114.]}
  67. - Permute: {}
  68. batch_size: 1
  69. architecture: YOLOX
  70. norm_type: sync_bn
  71. use_ema: True
  72. ema_decay: 0.9999
  73. ema_decay_type: "exponential"
  74. act: silu
  75. find_unused_parameters: True
  76. depth_mult: 1.33
  77. width_mult: 1.25
  78. YOLOX:
  79. backbone: CSPDarkNet
  80. neck: YOLOCSPPAN
  81. head: YOLOXHead
  82. size_stride: 32
  83. size_range: [15, 25] # multi-scale range [480*480 ~ 800*800]
  84. CSPDarkNet:
  85. arch: "X"
  86. return_idx: [2, 3, 4]
  87. depthwise: False
  88. YOLOCSPPAN:
  89. depthwise: False
  90. YOLOXHead:
  91. l1_epoch: 285
  92. depthwise: False
  93. loss_weight: {cls: 1.0, obj: 1.0, iou: 5.0, l1: 1.0}
  94. assigner:
  95. name: SimOTAAssigner
  96. candidate_topk: 10
  97. use_vfl: False
  98. nms:
  99. name: MultiClassNMS
  100. nms_top_k: 10000
  101. keep_top_k: 1000
  102. score_threshold: 0.001
  103. nms_threshold: 0.65
  104. # For speed while keep high mAP, you can modify 'nms_top_k' to 1000 and 'keep_top_k' to 100, the mAP will drop about 0.1%.
  105. # For high speed demo, you can modify 'score_threshold' to 0.25 and 'nms_threshold' to 0.45, but the mAP will drop a lot.
  106. epoch: 300
  107. LearningRate:
  108. base_lr: 0.01
  109. schedulers:
  110. - !CosineDecay
  111. max_epochs: 300
  112. min_lr_ratio: 0.05
  113. last_plateau_epochs: 15
  114. - !ExpWarmup
  115. epochs: 5
  116. OptimizerBuilder:
  117. optimizer:
  118. type: Momentum
  119. momentum: 0.9
  120. use_nesterov: True
  121. regularizer:
  122. factor: 0.0005
  123. type: L2
  124. # Exporting the model
  125. export:
  126. post_process: True # Whether post-processing is included in the network when export model.
  127. nms: True # Whether NMS is included in the network when export model.
  128. benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
  129. fuse_conv_bn: False