From 2b5fd266a6257fee98485d874967dd0627399ada Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Thu, 2 Feb 2023 20:16:19 +0800 Subject: [PATCH] fit architectures for cam (#7679) --- ppdet/modeling/architectures/mask_rcnn.py | 4 ++-- ppdet/modeling/heads/ppyoloe_r_head.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ppdet/modeling/architectures/mask_rcnn.py b/ppdet/modeling/architectures/mask_rcnn.py index a322f9f8e..bea6a3eea 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 aaf210632..fba401d7e 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 -- GitLab