当前位置: 首页>>代码示例>>Python>>正文


Python poolers.make_pooler方法代码示例

本文整理汇总了Python中maskrcnn_benchmark.modeling.poolers.make_pooler方法的典型用法代码示例。如果您正苦于以下问题:Python poolers.make_pooler方法的具体用法?Python poolers.make_pooler怎么用?Python poolers.make_pooler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maskrcnn_benchmark.modeling.poolers的用法示例。


在下文中一共展示了poolers.make_pooler方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from maskrcnn_benchmark.modeling import poolers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.poolers import make_pooler [as 别名]
def __init__(
        self, cfg, in_channels, builder, arch_def,
        head_name, use_blocks, stride_init, last_layer_scale,
    ):
        super(FBNetROIHead, self).__init__()
        assert in_channels == builder.last_depth
        assert isinstance(use_blocks, list)

        head_cfg_name = ARCH_CFG_NAME_MAPPING[head_name]
        self.pooler = poolers.make_pooler(cfg, head_cfg_name)

        stage = _get_head_stage(arch_def, head_name, use_blocks)

        assert stride_init in [0, 1, 2]
        if stride_init != 0:
            stage[0]["block"][3] = stride_init
        blocks = builder.add_blocks(stage)

        last_info = copy.deepcopy(arch_def["last"])
        last_info[1] = last_layer_scale
        last = builder.add_last(last_info)

        self.head = nn.Sequential(OrderedDict([
            ("blocks", blocks),
            ("last", last)
        ]))

        # output_blob = builder.add_final_pool(
        #     # model, output_blob, kernel_size=cfg.FAST_RCNN.ROI_XFORM_RESOLUTION)
        #     model,
        #     output_blob,
        #     kernel_size=int(cfg.FAST_RCNN.ROI_XFORM_RESOLUTION / stride_init),
        # )

        self.out_channels = builder.last_depth 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:37,代码来源:fbnet.py

示例2: __init__

# 需要导入模块: from maskrcnn_benchmark.modeling import poolers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.poolers import make_pooler [as 别名]
def __init__(
        self, cfg, in_channels, builder, arch_def,
        head_name, use_blocks, stride_init, last_layer_scale,
    ):
        super(FBNetROIHead, self).__init__()
        assert in_channels == builder.last_depth
        assert isinstance(use_blocks, list)

        head_cfg_name = ARCH_CFG_NAME_MAPPING[head_name]
        self.pooler = poolers.make_pooler(cfg, head_cfg_name)

        stage = _get_head_stage(arch_def, head_name, use_blocks)

        assert stride_init in [0, 1, 2]
        if stride_init != 0:
            stage[0]["block"][3] = stride_init
        blocks = builder.add_blocks(stage)

        last_info = copy.deepcopy(arch_def["last"])
        last_info[1] = last_layer_scale
        last = builder.add_last(last_info)

        self.head = nn.Sequential(OrderedDict([
            ("blocks", blocks),
            ("last", last)
        ]))

        self.out_channels = builder.last_depth 
开发者ID:simaiden,项目名称:Clothing-Detection,代码行数:30,代码来源:fbnet.py


注:本文中的maskrcnn_benchmark.modeling.poolers.make_pooler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。