本文整理汇总了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
示例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