Exemple #1
0
def predictprint(input_path=None, model_path=None, device=""):
    lp = get_model(model_path)
    data_sample = sample(
        device) if input_path is None else get_external_sample(input_path)
    return json.dumps(dict(zip(lp.classes_, lp.predict_proba(data_sample)[0])))
Exemple #2
0
def predict(input_path=None, model_path=None, device=""):
    lp = get_model(model_path)
    data_sample = sample(
        device) if input_path is None else get_external_sample(input_path)
    return lp.predict(data_sample)[0]