Abrar20 commited on
Commit
8ae49ae
·
verified ·
1 Parent(s): 06da83d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -21,7 +21,7 @@ vit_label_treatment = {
21
  "Potato___Early_blight": "Apply preventive fungicides; remove infected debris.",
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, which can predispose plants to infection. Optimize irrigation to maintain proper moisture levels and avoid water stress. At the first signs of brown spot, apply fungicides such as carbendazim or validamycin according to label recommendations. Additionally, remove and destroy infected residues to reduce pathogen inoculum and consider crop rotation to minimize 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 +187,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
- - 'Vit-model (Corn/Potato/Rice/Wheat)' -> use classify_image_vit
191
- - 'Keras-model (Apple/Blueberry/Cherry, etc.)' -> use classify_and_visualize_keras
192
  """
193
  if image is None:
194
  return "No image provided.", None, None, None
@@ -256,4 +256,4 @@ with gr.Blocks() as demo:
256
  inputs=[model_choice, inp_image]
257
  )
258
 
259
- demo.launch(share=True)
 
21
  "Potato___Early_blight": "Apply preventive fungicides; remove infected debris.",
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
  def main_model_selector(model_choice, image):
188
  """
189
  Dispatch function based on user choice of model:
190
+ - 'Vit-model (Corn, Potato, Rice, Wheat)' -> use classify_image_vit
191
+ - 'Keras-model (Apple, Blueberry, Cherry, etc.)' -> use classify_and_visualize_keras
192
  """
193
  if image is None:
194
  return "No image provided.", None, None, None
 
256
  inputs=[model_choice, inp_image]
257
  )
258
 
259
+ demo.launch(share=True)