yjh0410 vor 1 Jahr
Ursprung
Commit
1bd9524299
1 geänderte Dateien mit 0 neuen und 13 gelöschten Zeilen
  1. 0 13
      models/yolov5_af/loss.py

+ 0 - 13
models/yolov5_af/loss.py

@@ -33,19 +33,6 @@ class SetCriterion(object):
 
         return loss_box
 
-    def loss_bboxes_aux(self, pred_reg, gt_box, anchors, stride_tensors):
-        # xyxy -> cxcy&bwbh
-        gt_cxcy = (gt_box[..., :2] + gt_box[..., 2:]) * 0.5
-        gt_bwbh = gt_box[..., 2:] - gt_box[..., :2]
-        # encode gt box
-        gt_cxcy_encode = (gt_cxcy - anchors) / stride_tensors
-        gt_bwbh_encode = torch.log(gt_bwbh / stride_tensors)
-        gt_box_encode = torch.cat([gt_cxcy_encode, gt_bwbh_encode], dim=-1)
-        # l1 loss
-        loss_box_aux = F.l1_loss(pred_reg, gt_box_encode, reduction='none')
-
-        return loss_box_aux
-
     def __call__(self, outputs, targets):        
         """
             outputs['pred_obj']: List(Tensor) [B, M, 1]