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

update ops (#5443)

上级 ef342535
...@@ -209,7 +209,7 @@ class MaskHead(nn.Layer): ...@@ -209,7 +209,7 @@ class MaskHead(nn.Layer):
scale_factor (Tensor): The scale factor from origin size to input size scale_factor (Tensor): The scale factor from origin size to input size
""" """
if not self.export_onnx and rois.shape[0] == 0: if not self.export_onnx and rois.shape[0] == 0:
mask_out = paddle.full([1, 1, 1, 1], -1) mask_out = paddle.full([1, 1, 1], -1)
else: else:
bbox = [rois[:, 2:]] bbox = [rois[:, 2:]]
labels = rois[:, 0].cast('int32') labels = rois[:, 0].cast('int32')
......
...@@ -482,6 +482,8 @@ def collect_fpn_proposals(multi_rois, ...@@ -482,6 +482,8 @@ def collect_fpn_proposals(multi_rois,
rois_num = helper.create_variable_for_type_inference(dtype='int32') rois_num = helper.create_variable_for_type_inference(dtype='int32')
rois_num.stop_gradient = True rois_num.stop_gradient = True
outputs['RoisNum'] = rois_num outputs['RoisNum'] = rois_num
else:
rois_num = None
helper.append_op( helper.append_op(
type='collect_fpn_proposals', type='collect_fpn_proposals',
inputs=inputs, inputs=inputs,
...@@ -602,6 +604,8 @@ def distribute_fpn_proposals(fpn_rois, ...@@ -602,6 +604,8 @@ def distribute_fpn_proposals(fpn_rois,
for i in range(num_lvl) for i in range(num_lvl)
] ]
outputs['MultiLevelRoIsNum'] = rois_num_per_level outputs['MultiLevelRoIsNum'] = rois_num_per_level
else:
rois_num_per_level = None
helper.append_op( helper.append_op(
type='distribute_fpn_proposals', type='distribute_fpn_proposals',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册