未验证 提交 d4bbebf3 编写于 作者: F Feng Ni 提交者: GitHub

fix ppyoloe negative batch assign (#7958)

上级 84333007
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册