def make_model(network, input_shape):
    if network == 'resnet101_softmax':
        return resnet101_fpn(input_shape, channels=3, activation="softmax")
    elif network == 'resnet152_2':
        return resnet152_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'resnet101_2':
        return resnet101_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'resnet50_2':
        return resnet50_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'resnetv2':
        return inception_resnet_v2_fpn(input_shape,
                                       channels=2,
                                       activation="sigmoid")
    elif network == 'resnetv2_3':
        return inception_resnet_v2_fpn(input_shape,
                                       channels=3,
                                       activation="sigmoid")
    elif network == 'densenet169':
        return densenet_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'densenet169_softmax':
        return densenet_fpn(input_shape, channels=3, activation="softmax")
    elif network == 'resnet101_unet_2':
        return resnet101_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'xception_fpn':
        return xception_fpn(input_shape, channels=2, activation="sigmoid")
    elif network == 'resnet50_2':
        return resnet50_fpn(input_shape, channels=2, activation="sigmoid")
    else:
        raise ValueError('unknown network ' + network)
Пример #2
0
def make_model(network, black_detect=False):
    input_shape = (None, None, 3)
    if network == "xception_fpn":
        return xception_fpn(input_shape,
                            channels=1,
                            activation="sigmoid",
                            black_detect=black_detect)
    elif network == "resnet152":
        return resnet152_fpn(input_shape,
                             channels=1,
                             activation="sigmoid",
                             black_detect=black_detect)
    elif network == "inception_resnet_v2":
        return inception_resnet_v2_fpn(input_shape,
                                       channels=1,
                                       activation="sigmoid",
                                       black_detect=black_detect)
    elif network == "densenet169":
        return densenet_fpn(input_shape,
                            channels=1,
                            activation="sigmoid",
                            black_detect=black_detect)
    elif network == "testnet":
        return testnet(input_shape,
                       channels=1,
                       activation="sigmoid",
                       black_detect=black_detect)
    else:
        raise NotImplementedError("Network {} not implement.".format(network))