def load_model(params):
    try:
        model = torch.hub.load(params['repo'], 'custom', path=params['ckpt_path'], source='local', force_reload=True)
    except:
        print('torch.hub.load failed, try torch.load')
        model = torch.load(params['ckpt_path'])
    model.conf = params['conf']
    model.iou = params['iou']
    model.classes = None
    model.multi_label = False
    model.max_det = 50
    return model
def load_model(params):
    try:
        model = torch.hub.load(params['repo'], 'custom', path=params['ckpt_path'], source='local', force_reload=True)
    except:
        print('torch.hub.load failed, try torch.load')
        model = torch.load(params['ckpt_path'])
    model.conf = params['conf']
    model.iou = params['iou']
    model.classes = None
    model.multi_label = False
    model.max_det = 50
    return model