diff --git a/ppdet/modeling/architectures/mask_rcnn.py b/ppdet/modeling/architectures/mask_rcnn.py index a322f9f8e7b41d47d90b03b594fcdb47665c2c45..bea6a3eea0e0b4d301a99eb97fc6f159f6345db4 100644 --- a/ppdet/modeling/architectures/mask_rcnn.py +++ b/ppdet/modeling/architectures/mask_rcnn.py @@ -106,8 +106,8 @@ class MaskRCNN(BaseArch): im_shape = self.inputs['im_shape'] scale_factor = self.inputs['scale_factor'] - bbox, bbox_num = self.bbox_post_process(preds, (rois, rois_num), - im_shape, scale_factor) + bbox, bbox_num, before_nms_indexes = self.bbox_post_process( + preds, (rois, rois_num), im_shape, scale_factor) mask_out = self.mask_head( body_feats, bbox, bbox_num, self.inputs, feat_func=feat_func) diff --git a/ppdet/modeling/heads/ppyoloe_r_head.py b/ppdet/modeling/heads/ppyoloe_r_head.py index aaf21063204a0c5667f5edefaa31485ddfc6c1cc..fba401d7e7a7ff725938760be09b478d924dc705 100644 --- a/ppdet/modeling/heads/ppyoloe_r_head.py +++ b/ppdet/modeling/heads/ppyoloe_r_head.py @@ -419,6 +419,7 @@ class PPYOLOERHead(nn.Layer): axis=-1).reshape([-1, 1, 8]) pred_bboxes /= scale_factor if self.export_onnx: - return pred_bboxes, pred_scores - bbox_pred, bbox_num, _ = self.nms(pred_bboxes, pred_scores) - return bbox_pred, bbox_num + return pred_bboxes, pred_scores, None + bbox_pred, bbox_num, before_nms_indexes = self.nms(pred_bboxes, + pred_scores) + return bbox_pred, bbox_num, before_nms_indexes