zihaoz96 commited on
Commit
c42ba3e
1 Parent(s): f3b2340

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -38,10 +38,8 @@ def predict_image(image, model_name):
38
 
39
  pred = classifier.predict_image(img=image)
40
 
41
- label2id = json.load(open("./models/" + colname + "/best_model.pth"))["label2id"].keys()
42
- # vec = [100.0 if a.lower() == pred.lower() else 0.00 for a in label2id]
43
- acc = dict((label2id[i], "%.2f" % 100.0 if label2id[i].lower() == pred.lower() else 0.0) for i in range(len(label2id)))
44
- print(acc)
45
  return acc
46
  # return pred
47
 
 
38
 
39
  pred = classifier.predict_image(img=image)
40
 
41
+ acc = dict((labels[i], 0.0) for i in range(len(labels)))
42
+ acc[pred] = 100.0
 
 
43
  return acc
44
  # return pred
45