Spaces:
Runtime error
Runtime error
Commit
•
f6239ed
1
Parent(s):
dd63f40
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ model.save('modified_model.h5')
|
|
64 |
|
65 |
|
66 |
# custom_objects = {'BatchNormalization': tf.keras.layers.BatchNormalization}
|
67 |
-
|
68 |
|
69 |
# Load the h5 model
|
70 |
# model = tf.keras.models.load_model("model.h5")
|
@@ -104,7 +104,7 @@ def predict():
|
|
104 |
image = preprocess_image(image, target_size)
|
105 |
|
106 |
# Make prediction
|
107 |
-
predictions =
|
108 |
predicted_class = np.argmax(predictions, axis=-1)[0]
|
109 |
confidence = np.max(predictions, axis=-1)[0]
|
110 |
|
|
|
64 |
|
65 |
|
66 |
# custom_objects = {'BatchNormalization': tf.keras.layers.BatchNormalization}
|
67 |
+
loaded_model = load_model('modified_model.h5')
|
68 |
|
69 |
# Load the h5 model
|
70 |
# model = tf.keras.models.load_model("model.h5")
|
|
|
104 |
image = preprocess_image(image, target_size)
|
105 |
|
106 |
# Make prediction
|
107 |
+
predictions = loaded_model.predict(image)
|
108 |
predicted_class = np.argmax(predictions, axis=-1)[0]
|
109 |
confidence = np.max(predictions, axis=-1)[0]
|
110 |
|