Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ from transformers import AutoFeatureExtractor, AutoModelForImageClassification
|
|
6 |
|
7 |
dataset = load_dataset("beans")
|
8 |
|
9 |
-
extractor = AutoFeatureExtractor.from_pretrained("
|
10 |
-
model = AutoModelForImageClassification.from_pretrained("
|
11 |
|
12 |
labels = ['angular_leaf_spot', 'rust', 'healthy']
|
13 |
|
@@ -20,7 +20,7 @@ def classify(im):
|
|
20 |
return confidences
|
21 |
|
22 |
|
23 |
-
block = gr.Blocks(theme="
|
24 |
with block:
|
25 |
gr.HTML(
|
26 |
"""
|
@@ -33,9 +33,8 @@ with block:
|
|
33 |
"""
|
34 |
<p style="color:black">
|
35 |
<h4 style="font-color:powderblue;">
|
36 |
-
<center>Crop diseases are a major threat to food security, but their rapid identification remains difficult in many parts of the world due to the lack of the necessary infrastructure.
|
37 |
-
|
38 |
-
<center>Using A.I. models in plant disease detection and diagnosis has the potential to revolutionize the way we approach agriculture. By providing real-time monitoring and accurate detection of plant diseases, A.I. can help farmers reduce costs and increase crop</center>
|
39 |
</h4>
|
40 |
</p>
|
41 |
|
@@ -45,6 +44,18 @@ with block:
|
|
45 |
"""
|
46 |
)
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
with gr.Group():
|
49 |
image = gr.Image(type='pil')
|
50 |
outputs = gr.Label()
|
@@ -56,9 +67,7 @@ with block:
|
|
56 |
)
|
57 |
|
58 |
with gr.Group():
|
59 |
-
gr.Examples([
|
60 |
-
["ex1.jpg", "ex3.jpg"],
|
61 |
-
],
|
62 |
fn=classify,
|
63 |
inputs=[image],
|
64 |
outputs=[outputs],
|
|
|
6 |
|
7 |
dataset = load_dataset("beans")
|
8 |
|
9 |
+
extractor = AutoFeatureExtractor.from_pretrained("susnato/plant_disease_detection-beans")
|
10 |
+
model = AutoModelForImageClassification.from_pretrained("susnato/plant_disease_detection-beans")
|
11 |
|
12 |
labels = ['angular_leaf_spot', 'rust', 'healthy']
|
13 |
|
|
|
20 |
return confidences
|
21 |
|
22 |
|
23 |
+
block = gr.Blocks(theme="JohnSmith9982/small_and_pretty")
|
24 |
with block:
|
25 |
gr.HTML(
|
26 |
"""
|
|
|
33 |
"""
|
34 |
<p style="color:black">
|
35 |
<h4 style="font-color:powderblue;">
|
36 |
+
<center>Crop diseases are a major threat to food security, but their rapid identification remains difficult in many parts of the world due to the lack of the necessary infrastructure. <br><br>
|
37 |
+
Using Computer Vision models in plant disease detection and diagnosis has the potential to revolutionize the way we approach agriculture. By providing real-time monitoring and accurate detection of plant diseases, A.I. can help farmers reduce costs and increase crop</center>
|
|
|
38 |
</h4>
|
39 |
</p>
|
40 |
|
|
|
44 |
"""
|
45 |
)
|
46 |
|
47 |
+
with gr.Group():
|
48 |
+
with gr.Row():
|
49 |
+
gr.HTML(
|
50 |
+
"""
|
51 |
+
<center><h3>Our Approach</h3></center>
|
52 |
+
|
53 |
+
<p align="center">
|
54 |
+
<img src="https://huggingface.co/datasets/susnato/stock_images/resolve/main/diagram2.png">
|
55 |
+
</p>
|
56 |
+
"""
|
57 |
+
)
|
58 |
+
|
59 |
with gr.Group():
|
60 |
image = gr.Image(type='pil')
|
61 |
outputs = gr.Label()
|
|
|
67 |
)
|
68 |
|
69 |
with gr.Group():
|
70 |
+
gr.Examples(["ex3.jpg"],
|
|
|
|
|
71 |
fn=classify,
|
72 |
inputs=[image],
|
73 |
outputs=[outputs],
|