rice-detection-api / recommendations.py
PabsCanCode
Deploy rice disease detection on Gradio ZeroGPU
2620364
Raw History Blame Contribute Delete
5.19 kB
# Keyed by the disease model's raw labels (config.json id2label); "name" is what the API shows.
# Sources: IRRI Rice Knowledge Bank, PhilRice. Always confirm chemical use and dosage with a local agriculturist.
RECOMMENDATIONS = {
"Bacterial Leaf Blight": {
"name": "Bacterial Leaf Blight",
"category": "Bacterial disease",
"pathogen": "Xanthomonas oryzae pv. oryzae",
"severity": "high",
"treatment": [
"No fungicide cures it. Copper-based bactericides can slow the spread in early stages.",
"Drain the field so it stays dry for a few days, then reflood.",
"Stop adding nitrogen fertilizer until symptoms go down.",
],
"prevention": [
"Plant resistant varieties (with Xa4, xa5, Xa21 genes).",
"Use clean seed and remove infected stubble, straw and weeds.",
"Avoid injuring seedlings at transplanting and keep nitrogen use balanced.",
],
},
"Brown Spot": {
"name": "Brown Spot",
"category": "Fungal disease",
"pathogen": "Bipolaris oryzae (teleomorph Cochliobolus miyabeanus)",
"severity": "medium",
"treatment": [
"Spray a fungicide such as mancozeb, propiconazole or tebuconazole when spots appear.",
"Fix soil nutrient shortages, mainly potassium, silicon and nitrogen.",
],
"prevention": [
"Treat seed with fungicide or hot water (53-54°C for 10-12 minutes).",
"Apply balanced fertilizer and keep the soil from drying out.",
"Use resistant or tolerant varieties.",
],
},
"Healthy Rice Leaf": {
"name": "Healthy",
"category": "Healthy",
"pathogen": None,
"severity": "none",
"treatment": ["No treatment needed."],
"prevention": [
"Keep water and fertilizer balanced, keep weeds down, and scout the field every week.",
],
},
"Leaf Blast": {
"name": "Leaf Blast",
"category": "Fungal disease",
"pathogen": "Magnaporthe oryzae (anamorph Pyricularia oryzae)",
"severity": "high",
"treatment": [
"Spray a fungicide such as tricyclazole, isoprothiolane or azoxystrobin at the first sign of lesions.",
"Do not add nitrogen while the outbreak is active.",
],
"prevention": [
"Plant resistant varieties.",
"Split nitrogen into several smaller applications, and avoid too much of it.",
"Keep fields flooded where possible. Blast is worse in upland or dry conditions.",
"Avoid planting too densely.",
],
},
"Leaf Scald": {
"name": "Leaf Scald",
"category": "Fungal disease",
"pathogen": "Microdochium oryzae (teleomorph Monographella albescens)",
"severity": "medium",
"treatment": [
"Spray a fungicide such as propiconazole, mancozeb or a copper oxychloride product.",
],
"prevention": [
"Use treated or clean seed.",
"Avoid too much nitrogen and keep plants spaced wide enough.",
"Remove infected crop residue after harvest.",
],
},
"Narrow Brown Leaf Spot": {
"name": "Narrow Brown Leaf Spot",
"category": "Fungal disease",
"pathogen": "Cercospora janseana",
"severity": "low",
"treatment": [
"Spray a fungicide such as propiconazole or azoxystrobin if it spreads to the flag leaf before heading.",
],
"prevention": [
"Plant resistant varieties.",
"Apply enough potassium and keep fertilizer balanced.",
"Remove infected stubble and weeds.",
],
},
"Rice Hispa": {
"name": "Rice Hispa",
"category": "Insect pest damage",
"pathogen": "Dicladispa armigera (rice hispa beetle)",
"severity": "medium",
"treatment": [
"Cut off leaf tips at transplanting to remove the eggs and grubs.",
"Sweep nets or hand-pick adults in the early morning.",
"If damage passes the economic threshold, use a recommended insecticide (ask your local agriculturist).",
],
"prevention": [
"Keep fields and bunds free of grassy weeds.",
"Avoid too much nitrogen. Lush foliage draws the beetle.",
"Plant at the same time as neighboring farms.",
],
},
"Sheath Blight": {
"name": "Sheath Blight",
"category": "Fungal disease",
"pathogen": "Rhizoctonia solani (teleomorph Thanatephorus cucumeris)",
"severity": "high",
"treatment": [
"Spray a fungicide such as validamycin, hexaconazole, azoxystrobin or propiconazole at the base of the plants.",
"Drain the field for a while to lower the humidity in the canopy.",
],
"prevention": [
"Use wider spacing and lower seeding rates.",
"Apply balanced nitrogen, and avoid heavy early doses.",
"Remove weeds and infected stubble. Plow residue under after harvest.",
],
},
}