Roofus commited on
Commit
d79ba99
1 Parent(s): 6bcf550

Fixed percentages

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -32,7 +32,10 @@ def predict(img):
32
  if pred_label_idx:
33
  pred_labels_and_preds = {class_names[pred_label_idx-1]: float(pred_prob.item())}
34
  else:
35
- pred_labels_and_preds = {class_names[pred_label_idx+1]: 1-float(pred_prob.item())}
 
 
 
36
 
37
  end_time = timer()
38
  pred_time = round(end_time-start_time, 4)
 
32
  if pred_label_idx:
33
  pred_labels_and_preds = {class_names[pred_label_idx-1]: float(pred_prob.item())}
34
  else:
35
+ if 1-float(pred_prob.item()) < 75:
36
+ pred_labels_and_preds = {class_names[pred_label_idx]: 1-float(pred_prob.item()) }
37
+ else:
38
+ pred_labels_and_preds = {class_names[pred_label_idx+1]: 1-float(pred_prob.item())}
39
 
40
  end_time = timer()
41
  pred_time = round(end_time-start_time, 4)