Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from keras.models import load_model
|
|
| 11 |
|
| 12 |
img_height,img_width=180,180
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
from tensorflow.keras.models import Sequential
|
| 17 |
num_classes = 5
|
|
@@ -37,7 +37,7 @@ model.compile(optimizer='adam',
|
|
| 37 |
|
| 38 |
def predict_image(img):
|
| 39 |
img_2d=img.reshape(-1,180,180,3)
|
| 40 |
-
prediction=
|
| 41 |
return {class_names[i]: float(prediction[i]) for i in range(5)}
|
| 42 |
|
| 43 |
image = gr.inputs.Image(shape=(180,180))
|
|
|
|
| 11 |
|
| 12 |
img_height,img_width=180,180
|
| 13 |
|
| 14 |
+
model_flower = load_model('model_flower.h5')
|
| 15 |
|
| 16 |
from tensorflow.keras.models import Sequential
|
| 17 |
num_classes = 5
|
|
|
|
| 37 |
|
| 38 |
def predict_image(img):
|
| 39 |
img_2d=img.reshape(-1,180,180,3)
|
| 40 |
+
prediction=model_flower.predict(img_2d)[0]
|
| 41 |
return {class_names[i]: float(prediction[i]) for i in range(5)}
|
| 42 |
|
| 43 |
image = gr.inputs.Image(shape=(180,180))
|