yjh0410 преди 2 години
родител
ревизия
bda1f6113c
променени са 2 файла, в които са добавени 39 реда и са изтрити 43 реда
  1. 0 16
      config/model_config/rtdetr_config.py
  2. 39 27
      config/model_config/yolov7_config.py

+ 0 - 16
config/model_config/rtdetr_config.py

@@ -57,23 +57,7 @@ rtdetr_cfg = {
         'loss_box_weight': 5.0,
         'loss_giou_weight': 2.0,
         # ---------------- Train config ----------------
-        ## close strong augmentation
-        'no_aug_epoch': 20,
         'trainer_type': 'detr',
-        ## optimizer
-        'optimizer': 'adamw',
-        'momentum': None,
-        'weight_decay': 1e-4,
-        'clip_grad': 0.1,
-        ## model EMA
-        'ema_decay': 0.9998,
-        'ema_tau': 2000,
-        ## lr schedule
-        'scheduler': 'linear',
-        'lr0': 0.0001,
-        'lrf': 0.1,
-        'warmup_momentum': 0.8,
-        'warmup_bias_lr': 0.1,
         },
 
 }

+ 39 - 27
config/model_config/yolov7_config.py

@@ -2,10 +2,8 @@
 
 yolov7_cfg = {
     'yolov7_tiny':{
-        # input
-        'trans_type': 'yolov5_nano',
-        'multi_scale': [0.5, 1.5], # 320 -> 960
-        # model
+        # ---------------- Model config ----------------
+        ## Backbone
         'backbone': 'elannet_tiny',
         'pretrained': True,
         'bk_act': 'silu',
@@ -13,14 +11,14 @@ yolov7_cfg = {
         'bk_dpw': False,
         'stride': [8, 16, 32],  # P3, P4, P5
         'max_stride': 32,
-        # neck
+        ## Neck
         'neck': 'csp_sppf',
         'expand_ratio': 0.5,
         'pooling_size': 5,
         'neck_act': 'silu',
         'neck_norm': 'BN',
         'neck_depthwise': False,
-        # fpn
+        ## FPN
         'fpn': 'yolov7_pafpn',
         'fpn_act': 'silu',
         'fpn_norm': 'BN',
@@ -28,29 +26,33 @@ yolov7_cfg = {
         'nbranch': 2.0,       # number of branch in ELANBlockFPN
         'depth': 1.0,         # depth factor of each branch in ELANBlockFPN
         'width': 0.5,         # width factor of channel in FPN
-        # head
+        ## Head
         'head': 'decoupled_head',
         'head_act': 'silu',
         'head_norm': 'BN',
         'num_cls_head': 2,
         'num_reg_head': 2,
         'head_depthwise': False,
-        # matcher
+        # ---------------- Train config ----------------
+        ## input
+        'trans_type': 'yolov5_nano',
+        'multi_scale': [0.5, 1.25], # 320 -> 800
+        # ---------------- Assignment config ----------------
+        ## matcher
         'matcher': {'center_sampling_radius': 2.5,
                     'topk_candicate': 10},
-        # loss weight
+        # ---------------- Loss config ----------------
+        ## loss weight
         'loss_obj_weight': 1.0,
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
-        # training configuration
+        # ---------------- Train config ----------------
         'trainer_type': 'yolo',
     },
 
     'yolov7':{
-        # input
-        'trans_type': 'yolov5_large',
-        'multi_scale': [0.5, 1.25], # 320 -> 800
-        # model
+        # ---------------- Model config ----------------
+        ## Backbone
         'backbone': 'elannet_large',
         'pretrained': True,
         'bk_act': 'silu',
@@ -80,22 +82,26 @@ yolov7_cfg = {
         'num_cls_head': 2,
         'num_reg_head': 2,
         'head_depthwise': False,
-        # matcher
+        # ---------------- Train config ----------------
+        ## input
+        'trans_type': 'yolov5_large',
+        'multi_scale': [0.5, 1.25], # 320 -> 800
+        # ---------------- Assignment config ----------------
+        ## matcher
         'matcher': {'center_sampling_radius': 2.5,
                     'topk_candicate': 10},
-        # loss weight
+        # ---------------- Loss config ----------------
+        ## loss weight
         'loss_obj_weight': 1.0,
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
-        # training configuration
+        # ---------------- Train config ----------------
         'trainer_type': 'yolo',
     },
 
     'yolov7_x':{
-        # input
-        'trans_type': 'yolov5_huge',
-        'multi_scale': [0.5, 1.25], # 320 -> 640
-        # model
+        # ---------------- Model config ----------------
+        ## Backbone
         'backbone': 'elannet_huge',
         'pretrained': True,
         'bk_act': 'silu',
@@ -103,14 +109,14 @@ yolov7_cfg = {
         'bk_dpw': False,
         'stride': [8, 16, 32],  # P3, P4, P5
         'max_stride': 32,
-        # neck
+        ## Neck
         'neck': 'csp_sppf',
         'expand_ratio': 0.5,
         'pooling_size': 5,
         'neck_act': 'silu',
         'neck_norm': 'BN',
         'neck_depthwise': False,
-        # fpn
+        ## FPN
         'fpn': 'yolov7_pafpn',
         'fpn_act': 'silu',
         'fpn_norm': 'BN',
@@ -118,21 +124,27 @@ yolov7_cfg = {
         'nbranch': 4.0,        # number of branch in ELANBlockFPN
         'depth': 2.0,          # depth factor of each branch in ELANBlockFPN
         'width': 1.25,         # width factor of channel in FPN
-        # head
+        ## Head
         'head': 'decoupled_head',
         'head_act': 'silu',
         'head_norm': 'BN',
         'num_cls_head': 2,
         'num_reg_head': 2,
         'head_depthwise': False,
-        # matcher
+        # ---------------- Train config ----------------
+        ## input
+        'trans_type': 'yolov5_huge',
+        'multi_scale': [0.5, 1.25], # 320 -> 640
+        # ---------------- Assignment config ----------------
+        ## matcher
         'matcher': {'center_sampling_radius': 2.5,
                     'topk_candicate': 10},
-        # loss weight
+        # ---------------- Loss config ----------------
+        ## loss weight
         'loss_obj_weight': 1.0,
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
-        # training configuration
+        # ---------------- Train config ----------------
         'trainer_type': 'yolo',
     },