Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
-
pip install tensorflow
|
2 |
-
|
3 |
from tensorflow import keras
|
4 |
import gradio as gr
|
5 |
-
|
6 |
-
path_to_model = "/content/drive/MyDrive/modelPredict.h5"
|
7 |
|
8 |
model = keras.models.load_model(path_to_model)
|
9 |
|
@@ -14,7 +11,10 @@ def classify_image(inp):
|
|
14 |
class_names = ['Bacterialblight', 'Blast', 'Brownspot', 'Tungro']
|
15 |
return {class_names[i]: prediction[i] for i in range(4)}
|
16 |
|
17 |
-
|
|
|
18 |
inputs=gr.inputs.Image(shape=(224, 224)),
|
19 |
outputs=gr.outputs.Label(num_top_classes=4),
|
20 |
-
|
|
|
|
|
|
|
|
|
|
1 |
from tensorflow import keras
|
2 |
import gradio as gr
|
3 |
+
path_to_model = "modelPredict.h5"
|
|
|
4 |
|
5 |
model = keras.models.load_model(path_to_model)
|
6 |
|
|
|
11 |
class_names = ['Bacterialblight', 'Blast', 'Brownspot', 'Tungro']
|
12 |
return {class_names[i]: prediction[i] for i in range(4)}
|
13 |
|
14 |
+
|
15 |
+
iface = gr.Interface(fn=classify_image,
|
16 |
inputs=gr.inputs.Image(shape=(224, 224)),
|
17 |
outputs=gr.outputs.Label(num_top_classes=4),
|
18 |
+
theme = "darkhuggingface"
|
19 |
+
)
|
20 |
+
iface.launch(debug=True)
|