psinha823 commited on
Commit
cdd252f
·
1 Parent(s): 0aafaa9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  from PIL import Image
5
  import tensorflow as tf
6
 
7
- model = r'./model1_acc96_kera.h5'
8
 
9
  # Function to preprocess the image and make predictions
10
  def classify_alzheimers_image(input_image):
@@ -16,7 +16,8 @@ def classify_alzheimers_image(input_image):
16
  input_image_resized = np.expand_dims(input_image_resized, axis=0)
17
 
18
  # Making predictions
19
- predictions = model.predict(input_image_resized)
 
20
 
21
  # Getting the class with the highest probability
22
  class_idx = np.argmax(predictions)
 
4
  from PIL import Image
5
  import tensorflow as tf
6
 
7
+ model_path = r'./model1_acc96_kera.h5'
8
 
9
  # Function to preprocess the image and make predictions
10
  def classify_alzheimers_image(input_image):
 
16
  input_image_resized = np.expand_dims(input_image_resized, axis=0)
17
 
18
  # Making predictions
19
+ model_h5 = tf.keras.models.load_model(model_path)
20
+ predictions = model_h5.predict(input_image_resized)
21
 
22
  # Getting the class with the highest probability
23
  class_idx = np.argmax(predictions)