コード例 #1
0
def get_model(model_type, include_top=True):
    if model_type == 'shufflenet':
        input_shape = (224, 224, 3)
        model = ShuffleNet(groups=3, weights=None, include_top=include_top)
    elif model_type == 'shufflenet_v2':
        input_shape = (224, 224, 3)
        model = ShuffleNetV2(bottleneck_ratio=1, weights=None, include_top=include_top)
    elif model_type == 'nanonet':
        input_shape = (224, 224, 3)
        model = NanoNet(weights=None, include_top=include_top)
    else:
        raise ValueError('Unsupported model type')
    return model, input_shape[:2]
コード例 #2
0
def get_model(model_type, include_top=True):
    if model_type == 'shufflenet':
        input_shape = (224, 224, 3)
        model = ShuffleNet(input_shape=input_shape,
                           groups=3,
                           weights=None,
                           include_top=include_top)
    elif model_type == 'shufflenet_v2':
        input_shape = (224, 224, 3)
        model = ShuffleNetV2(input_shape=input_shape,
                             bottleneck_ratio=1,
                             weights=None,
                             include_top=include_top)
    elif model_type == 'nanonet':
        input_shape = (224, 224, 3)
        model = NanoNet(input_shape=input_shape,
                        weights=None,
                        include_top=include_top)
    elif model_type == 'darknet53':
        input_shape = (224, 224, 3)
        model = DarkNet53(input_shape=input_shape,
                          weights=None,
                          include_top=include_top)
    elif model_type == 'cspdarknet53':
        input_shape = (224, 224, 3)
        model = CSPDarkNet53(input_shape=input_shape,
                             weights=None,
                             include_top=include_top)
    elif model_type == 'mobilevit_s':
        input_shape = (256, 256, 3)
        model = MobileViT_S(input_shape=input_shape,
                            weights=None,
                            include_top=include_top)
    elif model_type == 'mobilevit_xs':
        input_shape = (256, 256, 3)
        model = MobileViT_XS(input_shape=input_shape,
                             weights=None,
                             include_top=include_top)
    elif model_type == 'mobilevit_xxs':
        input_shape = (256, 256, 3)
        model = MobileViT_XXS(input_shape=input_shape,
                              weights=None,
                              include_top=include_top)
    else:
        raise ValueError('Unsupported model type')
    return model, input_shape[:2]