KeoPachi commited on
Commit
74a3098
1 Parent(s): 8b29745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from tensorflow.keras.applications.resnet50 import preprocess_input
6
  from tensorflow.keras.models import load_model
7
 
8
  # Load your trained model
9
- model = load_model('C:\Users\Kevin Keo\OneDrive - ZHAW\Dokumente\Desktop\ZHAW WIN\FS24\KI-Anwendung\Pokemon\Mandatory Sauber\Mandatory Sauber\mein_modell.h5') # Ensure this path is correct
10
 
11
  def predict_pokemon(img):
12
  img = Image.fromarray(img.astype('uint8'), 'RGB') # Ensure the image is in RGB
@@ -16,7 +16,7 @@ def predict_pokemon(img):
16
  img_array = preprocess_input(img_array) # Preprocess the input as expected by ResNet50
17
 
18
  prediction = model.predict(img_array) # Predict using the model
19
- classes = ['Butterfree', 'Cubone', 'Dratini' ] # Specific Pokémon names
20
  return {classes[i]: float(prediction[0][i]) for i in range(3)} # Return the prediction
21
 
22
  # Define Gradio interface
 
6
  from tensorflow.keras.models import load_model
7
 
8
  # Load your trained model
9
+ model = load_model('/home/user/app/mein_modell.h5')
10
 
11
  def predict_pokemon(img):
12
  img = Image.fromarray(img.astype('uint8'), 'RGB') # Ensure the image is in RGB
 
16
  img_array = preprocess_input(img_array) # Preprocess the input as expected by ResNet50
17
 
18
  prediction = model.predict(img_array) # Predict using the model
19
+ classes = ['Charmeleon', 'Dewgong', 'Dratini' ] # Specific Pokémon names
20
  return {classes[i]: float(prediction[0][i]) for i in range(3)} # Return the prediction
21
 
22
  # Define Gradio interface