From 7c9489f1a71d3228863589d061be040a6e4f30d2 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Wed, 3 Aug 2022 15:54:49 +0900 Subject: [PATCH 1/2] move localization cost computation line for readability --- yolox/models/yolo_head.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yolox/models/yolo_head.py b/yolox/models/yolo_head.py index d67abd1a0..aae3a9016 100644 --- a/yolox/models/yolo_head.py +++ b/yolox/models/yolo_head.py @@ -473,14 +473,14 @@ def get_assignments( bboxes_preds_per_image = bboxes_preds_per_image.cpu() pair_wise_ious = bboxes_iou(gt_bboxes_per_image, bboxes_preds_per_image, False) - + pair_wise_ious_loss = -torch.log(pair_wise_ious + 1e-8) + gt_cls_per_image = ( F.one_hot(gt_classes.to(torch.int64), self.num_classes) .float() .unsqueeze(1) .repeat(1, num_in_boxes_anchor, 1) ) - pair_wise_ious_loss = -torch.log(pair_wise_ious + 1e-8) if mode == "cpu": cls_preds_, obj_preds_ = cls_preds_.cpu(), obj_preds_.cpu() From 2b7e3dcb13665605e1028f30daed482d641c0fa3 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Wed, 3 Aug 2022 16:21:05 +0900 Subject: [PATCH 2/2] clang --- yolox/models/yolo_head.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yolox/models/yolo_head.py b/yolox/models/yolo_head.py index aae3a9016..c4a834031 100644 --- a/yolox/models/yolo_head.py +++ b/yolox/models/yolo_head.py @@ -474,7 +474,7 @@ def get_assignments( pair_wise_ious = bboxes_iou(gt_bboxes_per_image, bboxes_preds_per_image, False) pair_wise_ious_loss = -torch.log(pair_wise_ious + 1e-8) - + gt_cls_per_image = ( F.one_hot(gt_classes.to(torch.int64), self.num_classes) .float()