pfrei commited on
Commit
7c2da1a
·
verified ·
1 Parent(s): 96e9aaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ from PIL import Image
4
  import numpy as np
5
 
6
  # Load your custom regression model
7
- model_path = "pokemon_model_transferlearning.keras"
8
  model = tf.keras.models.load_model(model_path)
9
 
10
  labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
@@ -13,7 +13,7 @@ labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
13
  def predict_regression(image):
14
  # Preprocess image
15
  image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
16
- image = image.resize((28, 28)).convert('L') #resize the image to 28x28 and converts it to gray scale
17
  image = np.array(image)
18
  print(image.shape)
19
  # Predict
 
4
  import numpy as np
5
 
6
  # Load your custom regression model
7
+ model_path = "pokemon_model_tl.keras"
8
  model = tf.keras.models.load_model(model_path)
9
 
10
  labels = ['Wartortle', 'Weedle', 'Weepinbell', 'Weezing']
 
13
  def predict_regression(image):
14
  # Preprocess image
15
  image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
16
+ image = image.resize((150, 140)).convert('RGB') #resize the image to 28x28 and converts it to gray scale
17
  image = np.array(image)
18
  print(image.shape)
19
  # Predict