Exemplo n.º 1
0
def create_model(configs):
    """Create model based on architecture name"""
    if (configs.arch == 'darknet') and (configs.cfgfile is not None):
        print('using darknet')
        model = Darknet(cfgfile=configs.cfgfile, use_giou_loss=configs.use_giou_loss)
    else:
        assert False, 'Undefined model backbone'

    return model
Exemplo n.º 2
0
def create_model(configs):
    """Create model based on architecture name"""
    if configs.arch == 'yolov4':
        model = Yolov4(yolov4conv137weight=configs.yolov4conv137weight, n_classes=configs.n_classes, inference=False)
    elif (configs.arch == 'darknet') and (configs.cfgfile is not None):
        print('using darknet')
        model = Darknet(cfgfile=configs.cfgfile)
    else:
        assert False, 'Undefined model backbone'

    return model