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

fix none output in rcnn (#2984)

上级 f1c322ab
......@@ -86,6 +86,13 @@ class BBoxPostProcess(object):
pred_result (Tensor): The final prediction results with shape [N, 6]
including labels, scores and bboxes.
"""
if bboxes.shape[0] == 0:
bbox_pred = paddle.to_tensor(
np.array(
[[-1, 0.0, 0.0, 0.0, 0.0, 0.0]], dtype='float32'))
bbox_num = paddle.to_tensor(np.array([1], dtype='int32'))
origin_shape = paddle.floor(im_shape / scale_factor + 0.5)
origin_shape_list = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册