Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
|
| 7 |
-
model_path = "
|
| 8 |
model = tf.keras.models.load_model(model_path)
|
| 9 |
|
| 10 |
# Define the core prediction function
|
|
@@ -23,15 +23,14 @@ def predict_bmwX(image):
|
|
| 23 |
prediction = tf.nn.softmax(prediction)
|
| 24 |
|
| 25 |
# Create a dictionary with the probabilities for each Pokemon
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
return {'X1': x1, 'X2': x2, 'X3': x3, 'X4': x4, 'X5': x5, 'X6': x6, 'X7': x7}
|
| 35 |
|
| 36 |
|
| 37 |
input_image = gr.Image()
|
|
|
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
|
| 7 |
+
model_path = "DogClassifier.keras"
|
| 8 |
model = tf.keras.models.load_model(model_path)
|
| 9 |
|
| 10 |
# Define the core prediction function
|
|
|
|
| 23 |
prediction = tf.nn.softmax(prediction)
|
| 24 |
|
| 25 |
# Create a dictionary with the probabilities for each Pokemon
|
| 26 |
+
borderCollie = np.round(float(prediction[0][0]), 2)
|
| 27 |
+
corgi = np.round(float(prediction[0][1]), 2)
|
| 28 |
+
germanShepard = np.round(float(prediction[0][2]), 2)
|
| 29 |
+
goldenRetriever = np.round(float(prediction[0][3]), 2)
|
| 30 |
+
pitBull = np.round(float(prediction[0][4]), 2)
|
| 31 |
+
rottweiler = np.round(float(prediction[0][4]), 2)
|
| 32 |
+
|
| 33 |
+
return {'Border Collie': borderCollie, 'Corgi': corgi, 'German Shepard': germanShepard, 'Golder Retriver': goldenRetriever, 'Pit Bull': pitBull, 'Rottweiler': rottweiler}
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
input_image = gr.Image()
|