bauckluc commited on
Commit
a9054f0
·
verified ·
1 Parent(s): bb8044e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  from PIL import Image
5
 
6
 
7
- model_path = "BMWXModelClassifier.keras"
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
- x1 = np.round(float(prediction[0][0]), 2)
27
- x2 = np.round(float(prediction[0][1]), 2)
28
- x3 = np.round(float(prediction[0][2]), 2)
29
- x4 = np.round(float(prediction[0][3]), 2)
30
- x5 = np.round(float(prediction[0][4]), 2)
31
- x6 = np.round(float(prediction[0][5]), 2)
32
- x7 = np.round(float(prediction[0][6]), 2)
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()