예제 #1
0
def build_backbone(backbone, output_stride, BatchNorm):
    if backbone == 'resnet':
        return resnet.ResNet101(output_stride, BatchNorm)
    elif backbone == 'xception':
        return xception.AlignedXception(output_stride, BatchNorm)
    elif backbone == 'drn':
        return drn.drn_d_54(BatchNorm)
    elif backbone == 'mobilenet':
        return mobilenet.MobileNetV2(output_stride, BatchNorm)
    else:
        raise NotImplementedError
예제 #2
0
def build_backbone(name, output_stride, batch_norm_cls=None, pretrained=True):
    if name == 'xception':
        return AlignedXception(output_stride, batch_norm_cls)

    elif name == 'resnet':
        return resnet.ResNet101(output_stride, batch_norm_cls)

    elif name == 'drn':
        return drn_d_54(batch_norm_cls)
    else:
        raise ValueError
예제 #3
0
def build_backbone(backbone, in_channels, output_stride, BatchNorm,
                   pretrained):
    if backbone == 'resnet101':
        return resnet.resnet101(in_channels, output_stride, BatchNorm,
                                pretrained)
    elif backbone == 'resnet50':
        return resnet.resnet50(in_channels, output_stride, BatchNorm,
                               pretrained)
    elif backbone == 'resnet34':
        return shallow_resnet.resnet34(in_channels, BatchNorm, pretrained)
    elif backbone == 'resnet18':
        return shallow_resnet.resnet18(in_channels, BatchNorm, pretrained)
    elif backbone == 'xception':
        return xception.AlignedXception(output_stride, BatchNorm)
    elif backbone == 'drn':
        return drn.drn_d_54(BatchNorm)
    elif backbone == 'mobilenet':
        return mobilenet.MobileNetV2(output_stride, BatchNorm)
    else:
        raise NotImplementedError