Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -10,12 +10,19 @@ from tensorflow.keras.models import Sequential
|
|
10 |
|
11 |
from keras.models import load_model
|
12 |
model1 = load_model('model1.h5')
|
|
|
|
|
13 |
def predict_image(img):
|
14 |
img_4d=img.reshape(-1,180,180,3)
|
15 |
prediction=model1.predict(img_4d)[0]
|
16 |
return {class_names[i]: float(prediction[i]) for i in range(5)}
|
17 |
-
|
18 |
image = gr.inputs.Image(shape=(180,180))
|
19 |
label = gr.outputs.Label(num_top_classes=5)
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
gr.Interface(fn=predict_image, inputs=image, outputs=label,interpretation='default').launch(debug='True')
|
|
|
10 |
|
11 |
from keras.models import load_model
|
12 |
model1 = load_model('model1.h5')
|
13 |
+
|
14 |
+
class_names = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']
|
15 |
def predict_image(img):
|
16 |
img_4d=img.reshape(-1,180,180,3)
|
17 |
prediction=model1.predict(img_4d)[0]
|
18 |
return {class_names[i]: float(prediction[i]) for i in range(5)}
|
19 |
+
|
20 |
image = gr.inputs.Image(shape=(180,180))
|
21 |
label = gr.outputs.Label(num_top_classes=5)
|
22 |
+
enable_queue=True
|
23 |
+
description="This is a Flower Classification Model made using a CNN.Deployed to Hugging Faces using Gradio."
|
24 |
+
examples = ['dandelion.jpg','sunflower.jpeg','tulip.jpg']
|
25 |
+
article="<p style='text-align: center'>Made by Aditya Narendra with 🖤</p>"
|
26 |
+
|
27 |
|
28 |
+
gr.Interface(fn=predict_image, inputs=image, outputs=label,title="Flower Classifier",description=description,article=article,examples=examples,enable_queue=enable_queue,interpretation='default').launch(debug='True')
|