Browse Source

use BCE for cls loss

yjh0410 2 years ago
parent
commit
18eaeac254
2 changed files with 7 additions and 9 deletions
  1. 7 7
      config/model_config/rtcdet_config.py
  2. 0 2
      models/detectors/rtcdet/loss.py

+ 7 - 7
config/model_config/rtcdet_config.py

@@ -45,7 +45,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_pico',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "aligned_simota",
+        'matcher': "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': "aligned_simota",
+        'matcher': "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': "aligned_simota",
+        'matcher': "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': "aligned_simota",
+        'matcher': "simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,
@@ -305,7 +305,7 @@ rtcdet_cfg = {
         'trans_type': 'yolox_medium',
         # ---------------- Assignment config ----------------
         ## Matcher
-        'matcher': "aligned_simota",
+        'matcher': "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': "aligned_simota",
+        'matcher': "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': "aligned_simota",
+        'matcher': "simota",
         'matcher_hpy': {"simota": {'center_sampling_radius': 2.5,
                                    'topk_candidate': 10},
                         "aligned_simota": {'soft_center_radius': 3.0,

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

@@ -1,4 +1,3 @@
-from typing import Any
 import torch
 import torch.nn.functional as F
 
@@ -116,7 +115,6 @@ class Criterion(object):
 
         return loss_box_aux
     
-
     # ----------------- Main process -----------------
     def loss_simota(self, outputs, targets, epoch=0):
         bs = outputs['pred_cls'][0].shape[0]