Tanishq commited on
Commit
db7370a
·
1 Parent(s): 181d089

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -75,8 +75,9 @@ if uploaded_image is not None:
75
  predicted_class_index = torch.argmax(predictions).item()
76
  predicted_class = class_names[predicted_class_index]
77
 
78
- val = torch.max(predictions):.2f
79
- text = "cat"
80
  if val > 0.5:
81
  text = "dog"
 
 
82
  st.write(f"Prediction: {text} with confidence {val:.2f}")
 
75
  predicted_class_index = torch.argmax(predictions).item()
76
  predicted_class = class_names[predicted_class_index]
77
 
78
+ val = torch.max(predictions)
 
79
  if val > 0.5:
80
  text = "dog"
81
+ else:
82
+ text = "cat"
83
  st.write(f"Prediction: {text} with confidence {val:.2f}")