未验证 提交 b1bc5702 编写于 作者: G Guanghua Yu 提交者: GitHub

fix RCNN model deploy infer (#2277)

上级 b11b3932
......@@ -79,8 +79,7 @@ class RoIAlign(object):
sampling_ratio=self.sampling_ratio,
rois_num=rois_num_dist[lvl],
aligned=self.aligned)
if roi_feat.shape[0] > 0:
rois_feat_list.append(roi_feat)
rois_feat_list.append(roi_feat)
rois_feat_shuffle = paddle.concat(rois_feat_list)
rois_feat = paddle.gather(rois_feat_shuffle, restore_index)
......
......@@ -81,9 +81,6 @@ class BBoxPostProcess(object):
scale_y, scale_x = scale_factor[i][0], scale_factor[i][1]
scale = paddle.concat([scale_x, scale_y, scale_x, scale_y])
expand_scale = paddle.expand(scale, [bbox_num[i], 4])
# TODO: Because paddle.expand transform error when dygraph
# to static, use reshape to avoid mistakes.
expand_scale = paddle.reshape(expand_scale, [bbox_num[i], 4])
origin_shape_list.append(expand_shape)
scale_factor_list.append(expand_scale)
......@@ -154,7 +151,7 @@ class MaskPostProcess(object):
# TODO: support bs > 1 and mask output dtype is bool
pred_result = paddle.zeros(
[num_mask, origin_shape[0][0], origin_shape[0][1]], dtype='int32')
if bboxes.shape[0] == 0:
if bbox_num == 1 and bboxes[0][0] == -1:
return pred_result
# TODO: optimize chunk paste
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册