Example #1
0
def iresgroupfix152(pretrained=False, **kwargs):
    """Constructs a iResGroupFix-152 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = iResGroupFix(ResGroupBlock, [3, 8, 36, 3], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(torch.load(download_from_url(model_urls['iresgroupfix152'],
                                                           root=default_cache_path)))
    return model
Example #2
0
def pyconvresnet152(pretrained=False, **kwargs):
    """Constructs a PyConvResNet-152 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = PyConvResNet(PyConvBlock, [3, 8, 36, 3], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(torch.load(download_from_url(model_urls['pyconvresnet152'],
                                                           root=default_cache_path)))
    return model
Example #3
0
def seiresnet1001(pretrained=False, **kwargs):
    """Constructs a iResNet-1001 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = seiResNet(Bottleneck, [4,  155, 170, 4], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(torch.load(download_from_url(model_urls['seiresnet1001'],
                                                           root=default_cache_path)))
    return model
Example #4
0
def seiresnet34(pretrained=False, **kwargs):
    """Constructs a iResNet-34 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = seiResNet(BasicBlock, [3, 4, 6, 3], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(torch.load(download_from_url(model_urls['seiresnet34'],
                                                           root=default_cache_path)))
    return model
Example #5
0
def resstage200(pretrained=False, **kwargs):
    """Constructs a ResStage-152 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResStage(Bottleneck, [3, 24, 36, 3], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(
            torch.load(
                download_from_url(model_urls['resstage200'],
                                  root=default_cache_path)))
    return model
Example #6
0
def resgroup101(pretrained=False, **kwargs):
    """Constructs a ResGroup-101 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResGroup(ResGroupBlock, [3, 4, 23, 3], **kwargs)
    if pretrained:
        os.makedirs(default_cache_path, exist_ok=True)
        model.load_state_dict(
            torch.load(
                download_from_url(model_urls['resgroup101'],
                                  root=default_cache_path)))
    return model