From 53638d3d1ae991a52cc61f94dfa666d0e3668de9 Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Thu, 7 May 2020 15:01:30 +0800 Subject: [PATCH] fix diou nms (#599) --- ppdet/modeling/ops.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ppdet/modeling/ops.py b/ppdet/modeling/ops.py index f4787cf70..4065e7d36 100644 --- a/ppdet/modeling/ops.py +++ b/ppdet/modeling/ops.py @@ -722,7 +722,7 @@ class MultiClassDiouNMS(object): cls_boxes = np.vstack(cls_boxes[start_idx:]) cls_ids = np.vstack(cls_ids[start_idx:]) - pred_result = np.hstack([cls_ids, cls_boxes]) + pred_result = np.hstack([cls_ids, cls_boxes]).astype(np.float32) # Limit to max_per_image detections **over all classes** image_scores = cls_boxes[:, 0] @@ -743,8 +743,8 @@ class MultiClassDiouNMS(object): fluid.default_main_program(), name='diou_nms_pred_result', dtype='float32', - shape=[6], - lod_level=1) + shape=[-1, 6], + lod_level=0) fluid.layers.py_func( func=_diou_nms, x=[bboxes, scores], out=pred_result) return pred_result -- GitLab