Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,7 @@ vit_label_treatment = {
|
|
22 |
"Potato___Late_blight": "Use certified seed tubers; fungicide sprays when conditions favor disease.",
|
23 |
"Rice___Leaf_blight": "Use resistant rice varieties, maintain field hygiene.",
|
24 |
"Rice___Brown_spot": "For brown spot of rice, employ integrated disease management practices. Use disease-resistant rice varieties and ensure balanced fertilization to prevent excessive nitrogen application. Maintain optimal irrigation to avoid water stress, and at the first signs of infection, apply fungicides such as carbendazim or validamycin following label recommendations. Remove and destroy infected plant debris to reduce inoculum, and consider crop rotation to mitigate disease recurrence.",
|
|
|
25 |
"Wheat___Leaf_rust": "Plant resistant wheat varieties, apply foliar fungicides if severe.",
|
26 |
# Fallback
|
27 |
"Unknown": "No specific treatment available."
|
@@ -187,8 +188,8 @@ def classify_and_visualize_keras(image):
|
|
187 |
def main_model_selector(model_choice, image):
|
188 |
"""
|
189 |
Dispatch function based on user choice of model:
|
190 |
-
- '
|
191 |
-
- 'Keras
|
192 |
"""
|
193 |
if image is None:
|
194 |
return "No image provided.", None, None, None
|
@@ -256,4 +257,4 @@ with gr.Blocks() as demo:
|
|
256 |
inputs=[model_choice, inp_image]
|
257 |
)
|
258 |
|
259 |
-
demo.launch(share=True)
|
|
|
22 |
"Potato___Late_blight": "Use certified seed tubers; fungicide sprays when conditions favor disease.",
|
23 |
"Rice___Leaf_blight": "Use resistant rice varieties, maintain field hygiene.",
|
24 |
"Rice___Brown_spot": "For brown spot of rice, employ integrated disease management practices. Use disease-resistant rice varieties and ensure balanced fertilization to prevent excessive nitrogen application. Maintain optimal irrigation to avoid water stress, and at the first signs of infection, apply fungicides such as carbendazim or validamycin following label recommendations. Remove and destroy infected plant debris to reduce inoculum, and consider crop rotation to mitigate disease recurrence.",
|
25 |
+
"Rice___Brown_Spot": "For brown spot of rice, employ integrated disease management practices. Use disease-resistant rice varieties and ensure balanced fertilization to prevent excessive nitrogen application. Maintain optimal irrigation to avoid water stress, and at the first signs of infection, apply fungicides such as carbendazim or validamycin following label recommendations. Remove and destroy infected plant debris to reduce inoculum, and consider crop rotation to mitigate disease recurrence.",
|
26 |
"Wheat___Leaf_rust": "Plant resistant wheat varieties, apply foliar fungicides if severe.",
|
27 |
# Fallback
|
28 |
"Unknown": "No specific treatment available."
|
|
|
188 |
def main_model_selector(model_choice, image):
|
189 |
"""
|
190 |
Dispatch function based on user choice of model:
|
191 |
+
- 'ViT (Corn, Potato, Rice, Wheat)' -> use classify_image_vit
|
192 |
+
- 'Keras (Apple, Blueberry, Cherry, etc.)' -> use classify_and_visualize_keras
|
193 |
"""
|
194 |
if image is None:
|
195 |
return "No image provided.", None, None, None
|
|
|
257 |
inputs=[model_choice, inp_image]
|
258 |
)
|
259 |
|
260 |
+
demo.launch(share=True)
|