Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from io import BytesIO
|
|
10 |
import os
|
11 |
|
12 |
model = YOLO('Corn-Disease50epoch.pt')
|
13 |
-
name = ['
|
14 |
image_directory = "/home/user/app/images"
|
15 |
# video_directory = "/home/user/app/video"
|
16 |
|
@@ -70,11 +70,11 @@ def response2(image: gr.Image = None,image_size: gr.Slider = 640, conf_threshold
|
|
70 |
text += (f"Detected {name[cl]} with confidence {round(conef,1)}% at ({xy[0]},{xy[1]})\n")
|
71 |
|
72 |
if name[cl] == "Corn Rust":
|
73 |
-
solution = "Apply fungicides with active ingredients like propiconazole or tebuconazole when symptoms appear.\n"
|
74 |
elif name[cl] == "Gray Leaf Spot":
|
75 |
-
solution = solution
|
76 |
elif name[cl] == "Leaf Blight":
|
77 |
-
solution = solution
|
78 |
|
79 |
# xywh = int(results.boxes.xywh)
|
80 |
# x = xywh[0]
|
|
|
10 |
import os
|
11 |
|
12 |
model = YOLO('Corn-Disease50epoch.pt')
|
13 |
+
name = ['Grey Leaf Spot','Corn Rust','Leaf Blight', 'Healthy']
|
14 |
image_directory = "/home/user/app/images"
|
15 |
# video_directory = "/home/user/app/video"
|
16 |
|
|
|
70 |
text += (f"Detected {name[cl]} with confidence {round(conef,1)}% at ({xy[0]},{xy[1]})\n")
|
71 |
|
72 |
if name[cl] == "Corn Rust":
|
73 |
+
solution = (f"{solution} Apply fungicides with active ingredients like propiconazole or tebuconazole when symptoms appear.\n")
|
74 |
elif name[cl] == "Gray Leaf Spot":
|
75 |
+
solution = (f"{solution} Use fungicides containing strobilurins (e.g., azoxystrobin) or triazoles.\n")
|
76 |
elif name[cl] == "Leaf Blight":
|
77 |
+
solution = (f"{solution} Treat with fungicides such as mancozeb or chlorothalonil during the early stages.\n")
|
78 |
|
79 |
# xywh = int(results.boxes.xywh)
|
80 |
# x = xywh[0]
|