Upload app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
|
2 |
|
3 |
import gradio as gr
|
4 |
-
from datasets import load_dataset
|
5 |
from PIL import Image
|
6 |
import matplotlib.pyplot as plt
|
7 |
import numpy as np
|
@@ -15,6 +14,7 @@ model3 = load_model('best_beans.h5')
|
|
15 |
|
16 |
leaf_class=['angular_leaf_spot', 'bean_rust', 'healthy']
|
17 |
|
|
|
18 |
def classify_image(img):
|
19 |
img_width, img_height = 224, 224
|
20 |
img = image.load_img(img, target_size = (img_width, img_height))
|
@@ -25,4 +25,4 @@ def classify_image(img):
|
|
25 |
|
26 |
gr.Interface(fn=classify_image,
|
27 |
inputs=gr.Image( type ="filepath"),
|
28 |
-
outputs=gr.Label(num_top_classes=1)).launch()
|
|
|
1 |
|
2 |
|
3 |
import gradio as gr
|
|
|
4 |
from PIL import Image
|
5 |
import matplotlib.pyplot as plt
|
6 |
import numpy as np
|
|
|
14 |
|
15 |
leaf_class=['angular_leaf_spot', 'bean_rust', 'healthy']
|
16 |
|
17 |
+
|
18 |
def classify_image(img):
|
19 |
img_width, img_height = 224, 224
|
20 |
img = image.load_img(img, target_size = (img_width, img_height))
|
|
|
25 |
|
26 |
gr.Interface(fn=classify_image,
|
27 |
inputs=gr.Image( type ="filepath"),
|
28 |
+
outputs=gr.Label(num_top_classes=1)).launch(debug=True)
|