Sfoglia il codice sorgente

debug AlignedSimOTA

yjh0410 2 anni fa
parent
commit
01b4ef8444
2 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 6 6
      config/model_config/rtcdet_config.py
  2. 2 2
      models/detectors/rtcdet/loss.py

+ 6 - 6
config/model_config/rtcdet_config.py

@@ -45,7 +45,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_pico',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -110,7 +110,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_nano',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -175,7 +175,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_small',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -240,7 +240,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_small',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -370,7 +370,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_large',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -435,7 +435,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_huge',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "simota",
+        'matcher': "aligned_simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,

+ 2 - 2
models/detectors/rtcdet/loss.py

@@ -304,7 +304,7 @@ class Criterion(object):
         box_targets_pos = box_targets[pos_inds]
         box_weight_pos = assign_metrics[pos_inds]
         loss_box = self.loss_bboxes(box_preds_pos, box_targets_pos)
-        loss_box *= box_weight_pos
+        # loss_box *= box_weight_pos
         loss_box = loss_box.sum() / normalizer
 
         # ------------------ Distribution focal loss  ------------------
@@ -320,7 +320,7 @@ class Criterion(object):
         strides_pos = strides[pos_inds]
         ## compute dfl
         loss_dfl = self.loss_dfl(reg_preds_pos, box_targets_pos, anchors_pos, strides_pos)
-        loss_dfl *= box_weight_pos
+        # loss_dfl *= box_weight_pos
         loss_dfl = loss_dfl.sum() / normalizer
 
         # total loss