def _get_bbox_head_logit(self, conv_feat): if self._head_feat is not None: return self._head_feat from mxnext.backbone.resnet_v2 import Builder unit = Builder.resnet_stage( conv_feat, name="stage4", num_block=3, filter=2048, stride=1, dilate=1, norm_type=self.p.normalizer, norm_mom=0.9, ndev=8 ) bn1 = X.fixbn(unit, name='bn1') relu1 = X.relu(bn1, name='relu1') relu1 = X.to_fp32(relu1, name='c5_to_fp32') pool1 = X.pool(relu1, global_pool=True, name='pool1') self._head_feat = pool1 return self._head_feat
def resnet_c4c5_factory(cls, depth, use_3x3_conv0, use_bn_preprocess, num_branch, branch_dilates, branch_ids, branch_bn_shared, branch_conv_shared, branch_deform, norm_type="local", norm_mom=0.9, ndev=None, fp16=False): c1, c2, c3, c4, c5 = cls.resnet_factory(depth, use_3x3_conv0, use_bn_preprocess, num_branch, branch_dilates, branch_ids, branch_bn_shared, branch_conv_shared, branch_deform, norm_type, norm_mom, ndev, fp16) c5 = X.fixbn(c5, "bn1") c5 = X.relu(c5) return c4, c5