ishaal007 commited on
Commit
b719478
·
1 Parent(s): d77dccf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,13 +45,13 @@ def predict(img) -> Tuple[Dict, float]:
45
 
46
  # Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
47
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
48
- pred_labels_and_prob_1={"Unknown Image" if v <0.75 else k:v for k,v in pred_labels_and_prob.items()}
49
 
50
  # Calculate the prediction time
51
  pred_time = round(timer() - start_time, 5)
52
 
53
  # Return the prediction dictionary and prediction time
54
- return pred_labels_and_probs_1, pred_time
55
 
56
  ### 4. Gradio app ###
57
 
 
45
 
46
  # Create a prediction label and prediction probability dictionary for each prediction class (this is the required format for Gradio's output parameter)
47
  pred_labels_and_probs = {class_names[i]: float(pred_probs[0][i]) for i in range(len(class_names))}
48
+ #pred_labels_and_prob_1={"Unknown Image" if v <0.75 else k:v for k,v in pred_labels_and_prob.items()}
49
 
50
  # Calculate the prediction time
51
  pred_time = round(timer() - start_time, 5)
52
 
53
  # Return the prediction dictionary and prediction time
54
+ return pred_labels_and_probs, pred_time
55
 
56
  ### 4. Gradio app ###
57