未验证 提交 e293ffb6 编写于 作者: W wangguanzhong 提交者: GitHub

fix postprocess (#7684)

上级 76ff51c6
...@@ -74,9 +74,9 @@ class BlazeFace(BaseArch): ...@@ -74,9 +74,9 @@ class BlazeFace(BaseArch):
self.inputs['gt_class']) self.inputs['gt_class'])
else: else:
preds, anchors = self.blaze_head(neck_feats, self.inputs['image']) preds, anchors = self.blaze_head(neck_feats, self.inputs['image'])
bbox, bbox_num = self.post_process(preds, anchors, bbox, bbox_num, before_nms_indexes = self.post_process(
self.inputs['im_shape'], preds, anchors, self.inputs['im_shape'],
self.inputs['scale_factor']) self.inputs['scale_factor'])
return bbox, bbox_num return bbox, bbox_num
def get_loss(self, ): def get_loss(self, ):
......
...@@ -75,9 +75,9 @@ class SSD(BaseArch): ...@@ -75,9 +75,9 @@ class SSD(BaseArch):
self.inputs['gt_class']) self.inputs['gt_class'])
else: else:
preds, anchors = self.ssd_head(body_feats, self.inputs['image']) preds, anchors = self.ssd_head(body_feats, self.inputs['image'])
bbox, bbox_num = self.post_process(preds, anchors, bbox, bbox_num, before_nms_indexes = self.post_process(
self.inputs['im_shape'], preds, anchors, self.inputs['im_shape'],
self.inputs['scale_factor']) self.inputs['scale_factor'])
return bbox, bbox_num return bbox, bbox_num
def get_loss(self, ): def get_loss(self, ):
......
...@@ -391,5 +391,6 @@ class FCOSRHead(nn.Layer): ...@@ -391,5 +391,6 @@ class FCOSRHead(nn.Layer):
], ],
axis=-1).reshape([-1, 1, 8]) axis=-1).reshape([-1, 1, 8])
pred_rboxes /= scale_factor pred_rboxes /= scale_factor
bbox_pred, bbox_num, _ = self.nms(pred_rboxes, pred_scores) bbox_pred, bbox_num, before_nms_indexes = self.nms(pred_rboxes,
return bbox_pred, bbox_num pred_scores)
return bbox_pred, bbox_num, before_nms_indexes
...@@ -258,7 +258,7 @@ class PPYOLOERHead(nn.Layer): ...@@ -258,7 +258,7 @@ class PPYOLOERHead(nn.Layer):
pad_gt_mask = gt_meta['pad_gt_mask'] pad_gt_mask = gt_meta['pad_gt_mask']
# label assignment # label assignment
if gt_meta['epoch_id'] < self.static_assigner_epoch: if gt_meta['epoch_id'] < self.static_assigner_epoch:
assigned_labels, assigned_bboxes, assigned_scores, _ = \ assigned_labels, assigned_bboxes, assigned_scores = \
self.static_assigner( self.static_assigner(
anchor_points, anchor_points,
stride_tensor, stride_tensor,
...@@ -271,7 +271,7 @@ class PPYOLOERHead(nn.Layer): ...@@ -271,7 +271,7 @@ class PPYOLOERHead(nn.Layer):
pred_bboxes.detach() pred_bboxes.detach()
) )
else: else:
assigned_labels, assigned_bboxes, assigned_scores, _ = \ assigned_labels, assigned_bboxes, assigned_scores = \
self.assigner( self.assigner(
pred_scores.detach(), pred_scores.detach(),
pred_bboxes.detach(), pred_bboxes.detach(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册