diff --git a/ppdet/modeling/assigners/atss_assigner.py b/ppdet/modeling/assigners/atss_assigner.py index a1e753c9434708d1fa80cc2499812906e5411f77..54b3d69f703a49c26c3f00fb7c9be62138efa5e4 100644 --- a/ppdet/modeling/assigners/atss_assigner.py +++ b/ppdet/modeling/assigners/atss_assigner.py @@ -126,7 +126,8 @@ class ATSSAssigner(nn.Layer): assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4]) assigned_scores = paddle.zeros( [batch_size, num_anchors, self.num_classes]) - return assigned_labels, assigned_bboxes, assigned_scores + mask_positive = paddle.zeros([batch_size, 1, num_anchors]) + return assigned_labels, assigned_bboxes, assigned_scores, mask_positive # 1. compute iou between gt and anchor bbox, [B, n, L] ious = iou_similarity(gt_bboxes.reshape([-1, 4]), anchor_bboxes) diff --git a/ppdet/modeling/assigners/task_aligned_assigner.py b/ppdet/modeling/assigners/task_aligned_assigner.py index 5a756fa67dac6d5ab6bfe276cf5da3535038ea56..636cd967f090d514dc38dd2f8c04b623741a77da 100644 --- a/ppdet/modeling/assigners/task_aligned_assigner.py +++ b/ppdet/modeling/assigners/task_aligned_assigner.py @@ -120,7 +120,8 @@ class TaskAlignedAssigner(nn.Layer): assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4]) assigned_scores = paddle.zeros( [batch_size, num_anchors, num_classes]) - return assigned_labels, assigned_bboxes, assigned_scores + mask_positive = paddle.zeros([batch_size, 1, num_anchors]) + return assigned_labels, assigned_bboxes, assigned_scores, mask_positive # compute iou between gt and pred bbox, [B, n, L] ious = batch_iou_similarity(gt_bboxes, pred_bboxes) diff --git a/ppdet/modeling/assigners/task_aligned_assigner_cr.py b/ppdet/modeling/assigners/task_aligned_assigner_cr.py index 4558d6e8ec7af5a59fc4975bff089616f0b0b209..f963592836090e8a6a374bd7334ebef1eefa24e4 100644 --- a/ppdet/modeling/assigners/task_aligned_assigner_cr.py +++ b/ppdet/modeling/assigners/task_aligned_assigner_cr.py @@ -96,7 +96,8 @@ class TaskAlignedAssigner_CR(nn.Layer): assigned_bboxes = paddle.zeros([batch_size, num_anchors, 4]) assigned_scores = paddle.zeros( [batch_size, num_anchors, num_classes]) - return assigned_labels, assigned_bboxes, assigned_scores + mask_positive = paddle.zeros([batch_size, 1, num_anchors]) + return assigned_labels, assigned_bboxes, assigned_scores, mask_positive # compute iou between gt and pred bbox, [B, n, L] ious = batch_iou_similarity(gt_bboxes, pred_bboxes)