Ahmed235 commited on
Commit
8b52248
1 Parent(s): d152d52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -31,15 +31,13 @@ def predict_image(image):
31
  predicted_class_index = np.argmax(probabilities)
32
  if predicted_class_index == 0:
33
  predicted_label = "Clean"
34
- predicted_probability = probabilities[0][0]*100
35
  else:
36
  predicted_label = "Carries"
37
- predicted_probability = probabilities[0][1]*100
38
- #confidence = float(np.max(probabilities))
39
- predicted_probability = str(predicted_probability)
40
-
41
  # Return the prediction result as a dictionary
42
- return {"Predicted Label": predicted_label, "evalute the teath": predicted_probability}
43
 
44
 
45
  # Create the interface
 
31
  predicted_class_index = np.argmax(probabilities)
32
  if predicted_class_index == 0:
33
  predicted_label = "Clean"
34
+ predicted_probability = probabilities[0][0] * 100 # Convert to percentage
35
  else:
36
  predicted_label = "Carries"
37
+ predicted_probability = probabilities[0][1] * 100 # Convert to percentage
38
+
 
 
39
  # Return the prediction result as a dictionary
40
+ return {"Predicted Label": predicted_label, "Evaluate the teeth": f"{predicted_probability:.2f}%"}
41
 
42
 
43
  # Create the interface