Update app.py
Browse files6 unmodified lines7891011121370 unmodified lines8485868788896 unmodified lines# This ensures it's loaded only once when the app starts.model = tf.keras.models.load_model("model.keras")IMG_SIZE = (224, 224)class_labels = ['Black Headed caterpillar', 'Eriophyid Mite Damage', 'Red Palm Weevil', 'Rhinoceros Beetle', 'White Grub']# --- NEW: Define a dictionary to store all text content ---# This is much cleaner than a long if/elif chain.70 unmodified lines**Biological Management**: Applying entomopathogenic nematodes or fungi that are natural parasites of the grubs can be a very effective long-term solution."""}}6 unmodified lines7891011121370 unmodified lines848586878889909192939495969798991001011026 unmodified lines# This ensures it's loaded only once when the app starts.model = tf.keras.models.load_model("model.keras")IMG_SIZE = (224, 224)class_labels = ['Black Headed caterpillar', 'Eriophyid Mite Damage', 'Red Palm Weevil', 'Rhinoceros Beetle', 'White Grub', 'Whitefly']# --- NEW: Define a dictionary to store all text content ---# This is much cleaner than a long if/elif chain.70 unmodified lines**Biological Management**: Applying entomopathogenic nematodes or fungi that are natural parasites of the grubs can be a very effective long-term solution.""""White Fly": {"info": """**Pest Identity**: Coconut whitefly (e.g., *Aleurodicus rugioperculatus* and related species) are tiny, sap-sucking insects that colonize the undersides of fronds. Nymphs and adults excrete honeydew, fostering sooty mold that interferes with photosynthesis.**Symptoms**: Silvery stippling/yellowing on leaflets, sticky honeydew deposits, black sooty mold coating fronds and nut husks, leaf desiccation and premature frond drop. Heavy infestations can reduce vigor, yield, and attract ants.""","management": """**Chemical Management**: Target early instars with systemic or translaminar insecticides (e.g., neonicotinoids or diamides where permitted) via trunk/soil application; rotate modes of action (IRAC groups) to delay resistance. Use horticultural oils or insecticidal soaps to suppress nymphs and remove honeydew/sooty mold. Always follow local regulations and label directions.**Cultural Management**: Prune and destroy heavily infested fronds to lower population pressure; improve spacing and canopy airflow to reduce whitefly buildup; wash fronds with water to remove honeydew/sooty mold; avoid excessive nitrogen fertilization which favors outbreaks; manage ant populations that protect whiteflies.**Biological Management**: Conserve and, where available, augment natural enemies (Encarsia/Eretmocerus parasitoid wasps, lacewings, lady beetles). Encourage parasitoids by minimizing broad-spectrum sprays and using selective products. Entomopathogenic fungi (e.g., *Beauveria bassiana*, *Isaria* spp.) can help suppress nymphs under suitable humidity."""}}
app.py+14-1