Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import numpy as np
|
|
4 |
from PIL import Image
|
5 |
import tensorflow as tf
|
6 |
|
7 |
-
|
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 |
-
|
|
|
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)
|