Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
39 |
-
predicted_probability = str(predicted_probability)
|
40 |
-
|
41 |
# Return the prediction result as a dictionary
|
42 |
-
return {"Predicted Label": predicted_label, "
|
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
|