amirkhanbloch commited on
Commit
ab6f7ef
·
verified ·
1 Parent(s): fe63481

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +78 -0
app.py CHANGED
@@ -92,6 +92,84 @@ treatment_dict = {
92
  }
93
  }
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  def preprocess_image(image, image_size=(224, 224)):
96
  # Convert image to grayscale
97
  image = np.array(image.convert('L'))
 
92
  }
93
  }
94
 
95
+ # Crop disease dictionary
96
+ crop_disease_dict = {
97
+ "Wheat": [
98
+ "Rust", "Powdery Mildew", "Fusarium Head Blight", "Septoria Leaf Blotch",
99
+ "Barley Yellow Dwarf", "Leaf Spot", "Bacterial Blight", "Loose Smut",
100
+ "Sharp Eyespot", "Root Rot", "Take-all", "Yellow Rust", "Brown Rust",
101
+ "Black Point", "Stem Rust", "Glume Blotch", "Dwarf Wheat Rust", "Wheat Blast"
102
+ ],
103
+ "Rice": [
104
+ "Brown Spot", "Leaf Blast", "Bacterial Blight", "Sheath Blight",
105
+ "Rice Tungro Virus", "False Smut", "Leaf Scald", "Stem Rot",
106
+ "Glume Discoloration", "Narrow Brown Leaf Spot", "Mosaic Virus",
107
+ "Ricelblast", "White Tip", "Bacterial Leaf Blight", "Fusarium Head Blight"
108
+ ],
109
+ "Corn": [
110
+ "Corn Smut", "Northern Corn Leaf Blight", "Gray Leaf Spot", "Goss's Wilt",
111
+ "Southern Rust", "Common Rust", "Seedling Blight", "Ear Rot",
112
+ "Fusarium Ear Rot", "Anthracnose", "Bacterial Leaf Streak", "Diplodia Ear Rot",
113
+ "Eyespot", "Root Rot", "Crown Rot", "Stalk Rot", "Kernel Rot"
114
+ ],
115
+ "Soybean": [
116
+ "Soybean Cyst Nematode", "Phytophthora Root Rot", "Bacterial Blight", "Downy Mildew",
117
+ "Brown Spot", "Sclerotinia Stem Rot", "Frogeye Leaf Spot", "Pod Blight",
118
+ "Root Rot", "Anthracnose", "Virus Diseases", "Septoria Leaf Spot",
119
+ "Rust", "White Mold", "Sudden Death Syndrome", "Charcoal Rot"
120
+ ],
121
+ "Tomato": [
122
+ "Late Blight", "Early Blight", "Leaf Spot", "Fusarium Wilt",
123
+ "Bacterial Spot", "Blossom End Rot", "Powdery Mildew", "Septoria Leaf Spot",
124
+ "Tobacco Mosaic Virus", "Gray Mold", "Canker", "Phytophthora Root Rot",
125
+ "Verticillium Wilt", "Downy Mildew", "Black Mold", "Nematode Infestation"
126
+ ],
127
+ "Potato": [
128
+ "Late Blight", "Early Blight", "Black Leg", "Scab",
129
+ "Powdery Scab", "Fusarium Wilt", "Tuber Blight", "Soft Rot",
130
+ "Verticillium Wilt", "Phytophthora Blight", "Golden Nematode",
131
+ "Bacterial Ring Rot", "Leaf Roll Virus", "Potato Virus X", "Cyst Nematodes"
132
+ ],
133
+ "Cotton": [
134
+ "Cotton Wilt", "Boll Rot", "Alternaria Leaf Spot", "Bacterial Blight",
135
+ "Fusarium Wilt", "Pink Bollworm", "Cotton Leaf Curl Virus", "Root Knot Nematode",
136
+ "Seedling Disease", "Boll Weevil", "Leaf Spot", "Webworm",
137
+ "Southern Blight", "Target Spot", "Anthracnose", "Thrips Damage"
138
+ ],
139
+ "Barley": [
140
+ "Barley Yellow Dwarf", "Powdery Mildew", "Net Blotch", "Fusarium Head Blight",
141
+ "Scald", "Hulled Barley Disease", "Root Rot", "Bacterial Leaf Blight",
142
+ "Corn Smut", "Kernel Blight", "Mosaic Virus", "Spot Blotch",
143
+ "Streak", "Barley Yellow Mosaic"
144
+ ],
145
+ "Cabbage": [
146
+ "Black Rot", "Downy Mildew", "Cabbage Looper", "Alternaria Leaf Spot",
147
+ "Clubroot", "Bacterial Soft Rot", "Fusarium Wilt", "Cabbage Maggot",
148
+ "Diamondback Moth", "Bacterial Blight", "Mosaic Virus", "White Rust",
149
+ "Leaf Spot", "Sclerotinia Rot"
150
+ ],
151
+ "Carrot": [
152
+ "Alternaria Leaf Blight", "Cavity Spot", "Fusarium Wilt", "Bacterial Soft Rot",
153
+ "Downy Mildew", "Carrot Rust Fly", "Crown Rot", "Powdery Mildew",
154
+ "Bacterial Blight", "Sclerotinia Rot", "Root Knot Nematode", "Mosaic Virus",
155
+ "Leaf Spot"
156
+ ],
157
+ "Onion": [
158
+ "Downy Mildew", "Onion Fly", "White Rot", "Botrytis Leaf Blight",
159
+ "Fusarium Basal Rot", "Bacterial Soft Rot", "Pink Root", "Mosaic Virus",
160
+ "Leaf Blight", "Pythium Root Rot", "Black Mold", "Fusarium Wilt"
161
+ ],
162
+ "Grapes": [
163
+ "Powdery Mildew", "Downy Mildew", "Botrytis Bunch Rot", "Black Rot",
164
+ "Phomopsis Cane and Leaf Spot", "Crown Gall", "Pierce's Disease",
165
+ "Bacterial Blight", "Eutypa Dieback", "Grapevine Leafroll",
166
+ "Sooty Mold", "Anthracnose", "Mealybug Infestation", "Fungal Leaf Spot"
167
+ ],
168
+ "Peppers": [
169
+ "Bacterial Spot", "Powdery Mildew", "Phytophthora Blight", "Blossom End Rot",
170
+ "Pepper Weevil", "Fusarium Wilt", "Downy
171
+
172
+
173
  def preprocess_image(image, image_size=(224, 224)):
174
  # Convert image to grayscale
175
  image = np.array(image.convert('L'))