From e42c6413d8673486ceade29802b36b97568adc8d Mon Sep 17 00:00:00 2001 From: xinyingxinying <63766413+xinyingxinying@users.noreply.github.com> Date: Fri, 17 Apr 2020 20:33:49 +0800 Subject: [PATCH] # add deform in fcos_heas --- ppdet/modeling/anchor_heads/fcos_head.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ppdet/modeling/anchor_heads/fcos_head.py b/ppdet/modeling/anchor_heads/fcos_head.py index de0b76410..9b5c4b3c0 100644 --- a/ppdet/modeling/anchor_heads/fcos_head.py +++ b/ppdet/modeling/anchor_heads/fcos_head.py @@ -22,7 +22,7 @@ import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr from paddle.fluid.initializer import Normal, Constant, NumpyArrayInitializer from paddle.fluid.regularizer import L2Decay -from ppdet.modeling.ops import ConvNorm +from ppdet.modeling.ops import ConvNorm, DeformConvNorm from ppdet.modeling.ops import MultiClassNMS from ppdet.core.workspace import register @@ -89,9 +89,13 @@ class FCOSHead(object): subnet_blob_cls = features subnet_blob_reg = features in_channles = features.shape[1] + if self.use_dcn_in_tower: + conv_norm = DeformConvNorm + else: + conv_norm = ConvNorm for lvl in range(0, self.num_convs): conv_cls_name = 'fcos_head_cls_tower_conv_{}'.format(lvl) - subnet_blob_cls = ConvNorm( + subnet_blob_cls = conv_norm( input=subnet_blob_cls, num_filters=in_channles, filter_size=3, @@ -104,7 +108,7 @@ class FCOSHead(object): norm_name=conv_cls_name + "_norm", name=conv_cls_name) conv_reg_name = 'fcos_head_reg_tower_conv_{}'.format(lvl) - subnet_blob_reg = ConvNorm( + subnet_blob_reg = conv_norm( input=subnet_blob_reg, num_filters=in_channles, filter_size=3, -- GitLab