Spaces:
Runtime error
Runtime error
Jamshaid89
commited on
Commit
•
110106a
1
Parent(s):
2566994
Modified predicted_label
Browse files
app.py
CHANGED
@@ -13,13 +13,8 @@ def predict_image(image):
|
|
13 |
# Make prediction
|
14 |
pred = model.predict(image)
|
15 |
|
16 |
-
predicted_label = ""
|
17 |
-
|
18 |
-
predicted_label = " Cat"
|
19 |
-
else:
|
20 |
-
predicted_label = "Dog"
|
21 |
-
|
22 |
-
predicted_label = f"{predicted_label} with prediction : {pred[0][0]}"
|
23 |
# Return the predicted label
|
24 |
return predicted_label
|
25 |
|
|
|
13 |
# Make prediction
|
14 |
pred = model.predict(image)
|
15 |
|
16 |
+
predicted_label = f"{(1-pred[0][0])*100}% Dog \n{pred[0][0]*100}% Cat \nFinal Prediction : {'Dog' if pred[0][0] < 0.5 else 'Cat'}"
|
17 |
+
|
|
|
|
|
|
|
|
|
|
|
18 |
# Return the predicted label
|
19 |
return predicted_label
|
20 |
|