Exemplo n.º 1
0
def darknet53(pretrained=False, **kwargs):
    model = Darknet53(**kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls['darknet53'],
                       map_location=torch.device('cpu')), model)
    return model
Exemplo n.º 2
0
def cspdarknettiny(pretrained=False, **kwargs):
    model = CSPDarknetTiny(**kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls['yolov4_cspdarknettiny'],
                       map_location=torch.device('cpu')), model)
    return model
def _repvgg(arch, pretrained, deploy, **kwargs):
    model = RepVGG(arch, deploy, **kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls[arch], map_location=torch.device('cpu')),
            model)

    return model
Exemplo n.º 4
0
def _vovnet(arch, pretrained, **kwargs):
    model = VoVNet(arch, **kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls[arch], map_location=torch.device('cpu')),
            model)

    return model
Exemplo n.º 5
0
def _resnet(arch, block, layers, pretrained, **kwargs):
    model = ResNet(block, layers, **kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls[arch], map_location=torch.device('cpu')),
            model)

    return model
def _efficientnet(arch, origin_globalparams, origin_blocks_args, pretrained,
                  **kwargs):
    model = EfficientNet(arch,
                         origin_globalparams=origin_globalparams,
                         origin_blocks_args=origin_blocks_args,
                         **kwargs)
    # only load state_dict()
    if pretrained:
        load_state_dict(
            torch.load(model_urls[arch], map_location=torch.device('cpu')),
            model)

    return model