Exemple #1
0
def rf_lw152(num_classes, pretrained=False, **kwargs):
    model = ResNetLW(Bottleneck, [3, 8, 36, 3],
                     num_classes=num_classes,
                     **kwargs)
    if pretrained:
        dataset = data_info.get(num_classes, None)
        if dataset:
            bname = '152_' + dataset.lower()
            key = 'rf_lw' + bname
            url = models_urls[bname]
            model.load_state_dict(maybe_download(key, url), strict=False)
    return model
Exemple #2
0
def mbv2(num_classes, pretrained=False, **kwargs):
    """Constructs the network.

    Args:
        num_classes (int): the number of classes for the segmentation head to output.

    """
    model = MBv2(num_classes, **kwargs)
    if pretrained:
        dataset = data_info.get(num_classes, None)
        if dataset:
            bname = 'mbv2_' + dataset.lower()
            key = 'rf_lw' + bname
            url = models_urls[bname]
            model.load_state_dict(maybe_download(key, url), strict=False)
    return model