bauckluc commited on
Commit
045e59b
·
verified ·
1 Parent(s): 846efc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,11 +8,11 @@ model_path = "BMWXModelClassifier.keras"
8
  model = tf.keras.models.load_model(model_path)
9
 
10
  # Define the core prediction function
11
- def predict_pokemon(image):
12
  # Preprocess image
13
  print(type(image))
14
  image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
15
- image = image.resize((150, 150)) #resize the image to 150x150
16
  image = np.array(image)
17
  image = np.expand_dims(image, axis=0) # same as image[None, ...]
18
 
@@ -36,7 +36,7 @@ def predict_pokemon(image):
36
 
37
  input_image = gr.Image()
38
  iface = gr.Interface(
39
- fn=predict_pokemon,
40
  inputs=input_image,
41
  outputs=gr.Label(),
42
  description="A simple mlp classification model for image classification using the mnist dataset.")
 
8
  model = tf.keras.models.load_model(model_path)
9
 
10
  # Define the core prediction function
11
+ def predict_bmwX(image):
12
  # Preprocess image
13
  print(type(image))
14
  image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image
15
+ image = image.resize((224, 224)) #resize the image to 224x224
16
  image = np.array(image)
17
  image = np.expand_dims(image, axis=0) # same as image[None, ...]
18
 
 
36
 
37
  input_image = gr.Image()
38
  iface = gr.Interface(
39
+ fn=predict_bmwX,
40
  inputs=input_image,
41
  outputs=gr.Label(),
42
  description="A simple mlp classification model for image classification using the mnist dataset.")