本文整理汇总了Python中maskrcnn_benchmark.modeling.make_layers.conv_with_kaiming_uniform方法的典型用法代码示例。如果您正苦于以下问题:Python make_layers.conv_with_kaiming_uniform方法的具体用法?Python make_layers.conv_with_kaiming_uniform怎么用?Python make_layers.conv_with_kaiming_uniform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maskrcnn_benchmark.modeling.make_layers
的用法示例。
在下文中一共展示了make_layers.conv_with_kaiming_uniform方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_res2net_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_res2net_fpn_backbone(cfg):
body = res2net.Res2Net(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
in_channels_stage2,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelMaxPool(),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例2: build_resnet_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
in_channels_stage2,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelMaxPool(),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例3: build_resnet_fpn_p3p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_p3p7_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
in_channels_p6p7 = in_channels_stage2 * 8 if cfg.MODEL.RETINANET.USE_C5 \
else out_channels
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(in_channels_p6p7, out_channels),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例4: build_detnasnet_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_detnasnet_fpn_backbone(cfg):
body = detnasnet.ShuffleNetV2DetNAS(cfg)
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
if '300M' in cfg.MODEL.BACKBONE.CONV_BODY:
in_channels_list = [64, 160, 320, 640,]
elif '1.3G' in cfg.MODEL.BACKBONE.CONV_BODY:
in_channels_list = [96, 240, 480, 960,]
elif '3.8G' in cfg.MODEL.BACKBONE.CONV_BODY:
in_channels_list = [172, 432, 864, 1728,]
else:
raise ValueError("Wrong backbone size.")
fpn = fpn_module.FPN(
in_channels_list= in_channels_list,
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU, cfg.MODEL.FPN.USE_SYNCBN
),
top_blocks=fpn_module.LastLevelMaxPool(),
)
if 'search' in cfg.MODEL.BACKBONE.CONV_BODY:
return body, fpn
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例5: build_detnasnet_fpn_p3p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_detnasnet_fpn_p3p7_backbone(cfg):
body = detnasnet.ShuffleNetV2DetNAS(cfg)
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[0, 160, 320, 640,],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU, cfg.MODEL.FPN.USE_SYNCBN
),
top_blocks=fpn_module.LastLevelP6P7(out_channels, out_channels, cfg.MODEL.RETINANET.P6P7_USE_SYNCBN),
)
if 'search' in cfg.MODEL.BACKBONE.CONV_BODY:
return body, fpn
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例6: build_resnet_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
in_channels_stage2,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelMaxPool(),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
return model
示例7: build_resnet_fpn_p4p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_p4p7_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
in_channels_p6p7 = in_channels_stage2 * 8 if cfg.MODEL.RETINANET.USE_C5 \
else out_channels
fpn = fpn_module.FPN(
in_channels_list=[
0,
0,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(in_channels_p6p7, out_channels),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例8: build_resnet_fpn_p3p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_p3p7_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
in_channels_p6p7 = in_channels_stage2 * 8 if cfg.MODEL.RETINANET.USE_C5 \
else out_channels
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(in_channels_p6p7, out_channels),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
return model
示例9: build_mnv2_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_mnv2_fpn_backbone(cfg):
body = mobilenet.MobileNetV2(cfg)
in_channels_stage2 = cfg.MODEL.BACKBONE.ENCODER_OUT_CHANNELS
out_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2[1],
in_channels_stage2[2],
in_channels_stage2[3],
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(out_channels, out_channels),
)
if cfg.MODEL.BACKBONE.SPLIT:
# separate backbone and fpn output
return body, fpn
else:
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
if cfg.MODEL.PANOPTIC.DECODER != "none":
return model, None
return model
示例10: build_resnet_fpn_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
in_channels_stage2,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelMaxPool(),
upsample_rates=cfg.MODEL.FPN.UPSAMPLE_RATE, # add by hui
upsample_mode=cfg.MODEL.FPN.UPSAMPLE_MODE # add by hui
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例11: build_resnet_fpn_p3p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_resnet_fpn_p3p7_backbone(cfg):
body = resnet.ResNet(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
in_channels_p6p7 = in_channels_stage2 * 8 if cfg.MODEL.RETINANET.USE_C5 \
else out_channels
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(in_channels_p6p7, out_channels),
upsample_rates=cfg.MODEL.FPN.UPSAMPLE_RATE, # add by hui
upsample_mode=cfg.MODEL.FPN.UPSAMPLE_MODE # add by hui
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
示例12: build_res2net_fpn_p3p7_backbone
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def build_res2net_fpn_p3p7_backbone(cfg):
body = res2net.Res2Net(cfg)
in_channels_stage2 = cfg.MODEL.RESNETS.RES2_OUT_CHANNELS
out_channels = cfg.MODEL.RESNETS.BACKBONE_OUT_CHANNELS
in_channels_p6p7 = in_channels_stage2 * 8 if cfg.MODEL.RETINANET.USE_C5 \
else out_channels
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2 * 2,
in_channels_stage2 * 4,
in_channels_stage2 * 8,
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(in_channels_p6p7, out_channels),
)
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
model.out_channels = out_channels
return model
# def build_backbone(cfg):
# assert cfg.MODEL.BACKBONE.CONV_BODY in registry.BACKBONES, \
# "cfg.MODEL.BACKBONE.CONV_BODY: {} are not registered in registry".format(
# cfg.MODEL.BACKBONE.CONV_BODY
# )
# return registry.BACKBONES[cfg.MODEL.BACKBONE.CONV_BODY](cfg)
示例13: add_conv_body_fpn
# 需要导入模块: from maskrcnn_benchmark.modeling import make_layers [as 别名]
# 或者: from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform [as 别名]
def add_conv_body_fpn(cfg, dim_in=3):
builder, arch_def = create_builder(cfg)
body = FBNetTrunk(builder, arch_def, dim_in)
in_channels_stage2 = cfg.MODEL.BACKBONE.ENCODER_OUT_CHANNELS
out_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
fpn = fpn_module.FPN(
in_channels_list=[
0,
in_channels_stage2[1],
in_channels_stage2[2],
in_channels_stage2[3]
],
out_channels=out_channels,
conv_block=conv_with_kaiming_uniform(
cfg.MODEL.FPN.USE_GN, cfg.MODEL.FPN.USE_RELU
),
top_blocks=fpn_module.LastLevelP6P7(out_channels, out_channels),
)
if cfg.MODEL.BACKBONE.SPLIT:
# separate backbone and fpn output
return body, fpn
else:
model = nn.Sequential(OrderedDict([("body", body), ("fpn", fpn)]))
if cfg.MODEL.PANOPTIC.DECODER != "none":
return model, None
return model