Download backend/data_benchmark.py from bapi143/CropAI: direct link, hf CLI and curl.
- Browser
- Download file 22.3 kB
-
https://huggingface.co/spaces/bapi143/CropAI/resolve/main/backend/data_benchmark.py
- Command line
-
hf download hf://spaces/bapi143/CropAI/backend/data_benchmark.py
-
curl -L -o data_benchmark.py https://huggingface.co/spaces/bapi143/CropAI/resolve/main/backend/data_benchmark.py
22.3 kB
| # -*- coding: utf-8 -*- | |
| """ | |
| CropAI Agronomic Knowledge Base - Benchmark & Horticultural Crops Module | |
| Covers Apple, Blueberry, Cherry, Grape, Peach, Bell Pepper, Raspberry, Strawberry, and Squash. | |
| """ | |
| from typing import Dict, Any | |
| BENCHMARK_KNOWLEDGE_BASE: Dict[str, Dict[str, Any]] = { | |
| # Apple | |
| "Apple___Apple_scab": { | |
| "name": "Apple Scab (सेब का स्कैब / खुरंड रोग)", | |
| "scientific_name": "Venturia inaequalis", | |
| "crop": "Apple (सेब)", | |
| "category": "Fungal", | |
| "severity": "Severe", | |
| "is_healthy": False, | |
| "season_and_weather": "Spring and summer; cool wet weather (Temp 15-22°C), frequent rains", | |
| "economic_injury_level": "Olive-green velvety spots on leaves or scabby fruit lesions", | |
| "symptoms": [ | |
| "Olive-green to dull greyish-brown velvety spots on leaves, becoming dark olive-black and raised", | |
| "Scabby, rough, corky, dark brown or black lesions on fruit surface; fruits crack and become distorted", | |
| "Premature leaf and fruit drop in heavy infections" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Prune and destroy infected leaves and fallen fruits from orchard floor"], | |
| "organic_control": ["Spray lime sulfur solution or Bordeaux mixture 1%"], | |
| "chemical_control": [ | |
| "Spray Difenoconazole 25% EC (Score) @ 0.3ml/L water (5ml per 16L tank; 60ml/acre in 200L water)", | |
| "Or Captan 50% WP @ 2.5g/L water (40g per 16L tank; 500g/acre)", | |
| "Or Dodine 65% WP @ 1g/L water (16g per 16L tank)" | |
| ] | |
| }, | |
| "prevention": ["Post-harvest spray of 5% Urea on orchard floor to accelerate leaf litter decomposition"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Apple___Black_rot": { | |
| "name": "Apple Black Rot / Frogeye Leaf Spot (सेब का ब्लैक रॉट)", | |
| "scientific_name": "Botryosphaeria obtusa", | |
| "crop": "Apple (सेब)", | |
| "category": "Fungal", | |
| "severity": "Moderate", | |
| "is_healthy": False, | |
| "season_and_weather": "Warm wet summer weather", | |
| "economic_injury_level": "Frogeye circular spots on leaves and firm rot on fruits", | |
| "symptoms": [ | |
| "Frogeye leaf spot: Small purple spots that enlarge with grey centers and dark purple margins", | |
| "Firm, concentric dark brown to black rot on fruits, turning entire fruit into a black mummified shrivelled ball", | |
| "Cankers on branches with cracked bark" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Prune dead twigs and cankered branches; remove mummified fruits"], | |
| "organic_control": ["Spray Copper Oxychloride 50% WP @ 3g/L water"], | |
| "chemical_control": ["Spray Captan 50% WP @ 2.5g/L or Mancozeb 75% WP @ 2.5g/L water"] | |
| }, | |
| "prevention": ["Pruning of diseased wood during winter dormancy"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Apple___Cedar_apple_rust": { | |
| "name": "Cedar Apple Rust (सेब का रतुआ रोग)", | |
| "scientific_name": "Gymnosporangium juniperi-virginianae", | |
| "crop": "Apple (सेब)", | |
| "category": "Fungal", | |
| "severity": "Moderate", | |
| "is_healthy": False, | |
| "season_and_weather": "Spring wet periods in vicinity of juniper trees", | |
| "economic_injury_level": "Bright yellow-orange spots on upper leaf surfaces", | |
| "symptoms": [ | |
| "Bright yellow-orange circular spots on upper surface of leaves, turning orange with black dots", | |
| "Cup-like fungal structures with hair-like projections (aecia) on the lower surface of leaves and fruit", | |
| "Severe defoliation and blemished cracked fruits" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Eradicate alternative juniper hosts within 500 meters of apple orchard"], | |
| "organic_control": ["Spray sulfur formulation @ 3g/L water"], | |
| "chemical_control": [ | |
| "Spray Myclobutanil 10% WP @ 1g/L water or Propiconazole 25% EC @ 1ml/L water" | |
| ] | |
| }, | |
| "prevention": ["Plant rust-resistant apple cultivars: Enterprise, Freedom, Liberty"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Apple___healthy": { | |
| "name": "Healthy Apple Tree (स्वस्थ सेब का पेड़)", | |
| "scientific_name": "Malus domestica (Optimal Foliage & Fruit Set)", | |
| "crop": "Apple (सेब)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "Temperate climate; lush dark-green serrated leaves, vigorous shoots and clean smooth fruits", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Lush green serrated leaves free from scab or frogeye spots", "Smooth, firm, unblemished fruits"], | |
| "treatment": { | |
| "immediate_action": ["Maintain balanced winter pruning and clean orchard sanitation"], | |
| "organic_control": ["Apply organic compost and boron micronutrient spray during pink bud stage"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Regular orchard scouting for early scab lesions during pink bud to petal fall stages"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Grape | |
| "Grape___Black_rot": { | |
| "name": "Grape Black Rot (अंगूर का ब्लैक रॉट रोग)", | |
| "scientific_name": "Guignardia bidwellii", | |
| "crop": "Grape (अंगूर)", | |
| "category": "Fungal", | |
| "severity": "Severe", | |
| "is_healthy": False, | |
| "season_and_weather": "Warm wet rainy spells (Temp 22-28°C)", | |
| "economic_injury_level": "Mummified black berries on bunches", | |
| "symptoms": [ | |
| "Small circular reddish-brown spots with dark borders on leaves", | |
| "Berries develop light brown spots that rapidly envelop the entire berry, turning it into a hard, shrivelled, black mummy covered with pycnidia", | |
| "Complete destruction of grape bunches if unchecked" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Remove and bury mummified grape clusters"], | |
| "organic_control": ["Spray Copper Hydroxide @ 2g/L water"], | |
| "chemical_control": [ | |
| "Spray Azoxystrobin 18.2% + Difenoconazole 11.4% SC @ 1ml/L water", | |
| "Or Mancozeb 75% WP @ 2.5g/L water", | |
| "Or Myclobutanil 10% WP @ 1g/L water" | |
| ] | |
| }, | |
| "prevention": ["Open canopy training (bower or trellis) for sunlight penetration"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Grape___healthy": { | |
| "name": "Healthy Grape Vine (स्वस्थ अंगूर की बेल)", | |
| "scientific_name": "Vitis vinifera (Optimal Canopy & Bunch Vigor)", | |
| "crop": "Grape (अंगूर)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "All seasons; broad lobed vibrant green leaves, clean tendrils and dense healthy grape clusters", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Broad deep-green lobed foliage free from downy/powdery mildew or black rot", "Firm, uniform berry bunches with natural waxy bloom"], | |
| "treatment": { | |
| "immediate_action": ["Maintain optimal trellis canopy pruning and drip irrigation"], | |
| "organic_control": ["Apply potassium-rich bio-tonics during berry sizing"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Prune excess foliage to maintain bunch aeration"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Bell Pepper | |
| "Pepper,_bell___Bacterial_spot": { | |
| "name": "Bell Pepper / Shimla Mirch Bacterial Spot (शिमला मिर्च का जीवाणु धब्बा)", | |
| "scientific_name": "Xanthomonas campestris pv. vesicatoria", | |
| "crop": "Bell Pepper / Capsicum (शिमला मिर्च)", | |
| "category": "Bacterial", | |
| "severity": "Severe", | |
| "is_healthy": False, | |
| "season_and_weather": "Warm, humid, rainy weather (Temp 24-30°C, RH > 85%)", | |
| "economic_injury_level": "Small water-soaked blister spots on leaves and fruit", | |
| "symptoms": [ | |
| "Small, circular to irregular, water-soaked dark brown spots with chlorotic haloes on leaves", | |
| "Raised, corky, blister-like brown pustules on green bell peppers", | |
| "Severe leaf yellowing and defoliation resulting in sunscald of exposed fruits" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Avoid overhead irrigation; destroy severely infected plants"], | |
| "organic_control": ["Spray Copper Oxychloride 50% WP @ 2.5g/L water"], | |
| "chemical_control": [ | |
| "Spray Streptocycline 6g + Copper Oxychloride 500g in 200L water per acre", | |
| "Or Plantomycin 1g/L + Copper Hydroxide @ 2g/L water" | |
| ] | |
| }, | |
| "prevention": ["Seed treatment with Streptocycline (1g in 10L for 30 minutes)", "Crop rotation with non-solanaceous crops"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Pepper,_bell___healthy": { | |
| "name": "Healthy Bell Pepper (स्वस्थ शिमला मिर्च फसल)", | |
| "scientific_name": "Capsicum annuum var. grossum (Optimal Canopy & Fruit Health)", | |
| "crop": "Bell Pepper / Capsicum (शिमला मिर्च)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "All seasons; deep glossy green leaves, sturdy branching, blocky firm bell peppers", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Lush dark-green smooth foliage free from bacterial spots or leaf curling", "Firm, glossy, thick-walled blocky green, red, or yellow capsicums"], | |
| "treatment": { | |
| "immediate_action": ["Maintain balanced fertigation and staking"], | |
| "organic_control": ["Apply vermicompost and calcium nitrate to prevent blossom end rot"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Scout leaf undersides weekly for early thrips and mite symptoms"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Squash | |
| "Squash___Powdery_mildew": { | |
| "name": "Squash / Cucurbits Powdery Mildew (कद्दूवर्गीय फसलों का चूर्णी रोग)", | |
| "scientific_name": "Podosphaera xanthii (Erysiphe cichoracearum)", | |
| "crop": "Squash / Cucurbits (कद्दू/लौकी)", | |
| "category": "Fungal", | |
| "severity": "Moderate", | |
| "is_healthy": False, | |
| "season_and_weather": "Dry warm sunny days with humid nights and dense canopy shade", | |
| "economic_injury_level": "White talcum powder coating covering > 15% leaf area", | |
| "symptoms": [ | |
| "White talcum-powder-like fungal patches on both upper and lower surfaces of leaves and stems", | |
| "Patches coalesce covering entire leaves; leaves turn yellow, brown, and dry into brittle brown paper", | |
| "Premature defoliation, stunted fruit growth, and sunscald of exposed squash fruits" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Spray lower leaves and inner canopy where white powder starts"], | |
| "organic_control": [ | |
| "Spray wettable sulfur 80% WDG (Sulfex) @ 3g/L water (50g per 16L tank; 600g/acre in 200L water)", | |
| "Apply baking soda (Sodium bicarbonate) solution @ 5g/L with 2ml liquid soap or raw milk (1:9 ratio)" | |
| ], | |
| "chemical_control": [ | |
| "Spray Hexaconazole 5% SC (Contaf) @ 2ml/L water (32ml per 16L tank; 400ml/acre in 200L water)", | |
| "Or Tebuconazole 25.9% EC (Folicur) @ 1ml/L water (16ml per 16L tank; 200ml/acre)", | |
| "Or Azoxystrobin 18.2% + Difenoconazole 11.4% SC @ 1ml/L water (16ml per 16L tank)" | |
| ] | |
| }, | |
| "prevention": ["Maintain wide plant spacing for sunlight and airflow", "Plant resistant cultivars"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Strawberry | |
| "Strawberry___Leaf_scorch": { | |
| "name": "Strawberry Leaf Scorch (स्ट्रॉबेरी का पत्ती झुलसा)", | |
| "scientific_name": "Diplocarpon earlianum", | |
| "crop": "Strawberry (स्ट्रॉबेरी)", | |
| "category": "Fungal", | |
| "severity": "Moderate", | |
| "is_healthy": False, | |
| "season_and_weather": "Warm wet rainy weather", | |
| "economic_injury_level": "Purplish-brown irregular spots coalescing on leaves", | |
| "symptoms": [ | |
| "Irregular purplish-red to dark brown spots on upper leaf surfaces without white centers", | |
| "Lesions coalesce causing leaves to appear burned or scorched; margins curl upwards", | |
| "Calyx leaves turn brown and die, resulting in stunted, unmarketable berries" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Prune and remove scorched foliage after fruiting"], | |
| "organic_control": ["Spray Copper Oxychloride 50% WP @ 2g/L water"], | |
| "chemical_control": [ | |
| "Spray Captan 50% WP @ 2g/L water or Azoxystrobin 23% SC @ 1ml/L water", | |
| "Or Myclobutanil 10% WP @ 1g/L water" | |
| ] | |
| }, | |
| "prevention": ["Drip irrigation instead of overhead sprinklers", "Plant on plastic-mulched raised beds"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Strawberry___healthy": { | |
| "name": "Healthy Strawberry Plant (स्वस्थ स्ट्रॉबेरी पौधा)", | |
| "scientific_name": "Fragaria ananassa (Optimal Crown & Berry Health)", | |
| "crop": "Strawberry (स्ट्रॉबेरी)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "All seasons; deep glossy green trifoliate foliage, white flowers, vibrant red berries", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Lush glossy green trifoliate leaves with serrated margins free from spots", "Clean white flowers and glossy red cone-shaped berries on clean mulch"], | |
| "treatment": { | |
| "immediate_action": ["Maintain clean straw or plastic mulch under fruit clusters to prevent soil contact"], | |
| "organic_control": ["Apply compost tea and seaweed extract every 15 days"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Ensure raised beds are well-drained"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Peach | |
| "Peach___Bacterial_spot": { | |
| "name": "Peach Bacterial Spot (आड़ू का जीवाणु धब्बा रोग)", | |
| "scientific_name": "Xanthomonas arboricola pv. pruni", | |
| "crop": "Peach (आड़ू)", | |
| "category": "Bacterial", | |
| "severity": "Severe", | |
| "is_healthy": False, | |
| "season_and_weather": "Warm, wet, windy spring weather", | |
| "economic_injury_level": "Angular purplish spots on leaves and pitted fruit lesions", | |
| "symptoms": [ | |
| "Small angular water-soaked purplish spots that drop out, creating a 'shot-hole' appearance on leaves", | |
| "Cracked, sunken, pitted dark lesions on fruit surface exuding amber gum", | |
| "Severe premature defoliation leading to fruit sunburn and weakened tree vigor" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Prune infected cankered twigs during winter dormancy"], | |
| "organic_control": ["Spray Copper Oxychloride @ 3g/L or Bordeaux mixture 1%"], | |
| "chemical_control": [ | |
| "Spray Streptocycline 6g + Copper Oxychloride 500g in 200L water per acre", | |
| "Or Plantomycin 1g/L + Copper Hydroxide @ 2g/L water" | |
| ] | |
| }, | |
| "prevention": ["Plant resistant peach varieties", "Avoid high nitrogen fertilization"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Peach___healthy": { | |
| "name": "Healthy Peach Tree (स्वस्थ आड़ू का पेड़)", | |
| "scientific_name": "Prunus persica (Optimal Foliage & Fruit Vigor)", | |
| "crop": "Peach (आड़ू)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "Temperate climate; lanceolate deep-green leaves, pink blossoms, velvety blush-red peaches", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Healthy lanceolate glossy green leaves free from shot holes or yellowing", "Smooth velvety peaches free from gumming or pitted brown lesions"], | |
| "treatment": { | |
| "immediate_action": ["Maintain optimal fruit thinning for large fruit size"], | |
| "organic_control": ["Apply organic compost around drip line"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Prune during winter to maintain open vase canopy architecture"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Blueberry | |
| "Blueberry___healthy": { | |
| "name": "Healthy Blueberry Bush (स्वस्थ ब्लूबेरी पौधा)", | |
| "scientific_name": "Vaccinium corymbosum (Optimal Canopy & Berry Setting)", | |
| "crop": "Blueberry (ब्लूबेरी)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "Acidic soil conditions; oval glossy dark-green leaves, bell-shaped flowers, plump indigo berries", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Lush glossy green oval leaves free from leaf spots or chlorosis", "Firm, plump indigo-blue berries covered with natural powdery bloom"], | |
| "treatment": { | |
| "immediate_action": ["Maintain acidic soil pH (4.5 to 5.2) using elemental sulfur and pine needle mulch"], | |
| "organic_control": ["Apply ericoid mycorrhizal inoculants"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Bird netting over bush clusters during berry ripening"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Cherry | |
| "Cherry___Powdery_mildew": { | |
| "name": "Cherry Powdery Mildew (चेरी का चूर्णिल आसिता)", | |
| "scientific_name": "Podosphaera clandestina", | |
| "crop": "Cherry (चेरी)", | |
| "category": "Fungal", | |
| "severity": "Moderate", | |
| "is_healthy": False, | |
| "season_and_weather": "Late spring and summer; warm dry days with humid nights", | |
| "economic_injury_level": "White powdery fungal growth on leaves and green fruit", | |
| "symptoms": [ | |
| "White circular patches of powdery mildew on underside of leaves, causing leaves to cup upward and distort", | |
| "Fungal mycelium covers developing green and ripening cherries, causing them to crack, shrivel, and fail to mature", | |
| "Severe reduction in commercial fruit packout" | |
| ], | |
| "treatment": { | |
| "immediate_action": ["Prune watersprouts to improve canopy airflow"], | |
| "organic_control": ["Spray wettable sulfur 80% WDG @ 3g/L water (50g per 16L tank)"], | |
| "chemical_control": [ | |
| "Spray Myclobutanil 10% WP @ 1g/L water or Tebuconazole 25.9% EC @ 1ml/L water", | |
| "Or Azoxystrobin 23% SC @ 1ml/L water" | |
| ] | |
| }, | |
| "prevention": ["Canopy pruning to maximize sunlight exposure", "Avoid overhead sprinkler irrigation"], | |
| "expert_consultation_recommended": False | |
| }, | |
| "Cherry___healthy": { | |
| "name": "Healthy Cherry Tree (स्वस्थ चेरी का पेड़)", | |
| "scientific_name": "Prunus avium (Optimal Foliage & Berry Health)", | |
| "crop": "Cherry (चेरी)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "Temperate climate; vibrant serrated ovate leaves, white spring blossoms, glossy plump cherries", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Clean, vibrant dark-green leaves free from powdery mildew or shot holes", "Glossy, firm, unblemished deep red cherries with green stems"], | |
| "treatment": { | |
| "immediate_action": ["Maintain optimal moisture and winter orchard sanitation"], | |
| "organic_control": ["Apply organic compost and foliar seaweed extract"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Install bird netting during fruit color turning stage"], | |
| "expert_consultation_recommended": False | |
| }, | |
| # Raspberry | |
| "Raspberry___healthy": { | |
| "name": "Healthy Raspberry Bush (स्वस्थ रास्पबेरी पौधा)", | |
| "scientific_name": "Rubus idaeus (Optimal Cane & Berry Vigor)", | |
| "crop": "Raspberry (रास्पबेरी)", | |
| "category": "Healthy", | |
| "severity": "Healthy", | |
| "is_healthy": True, | |
| "season_and_weather": "Temperate cool climate; compound serrated leaves, upright canes, plump red aggregate berries", | |
| "economic_injury_level": "None", | |
| "symptoms": ["Vigorous green compound leaves free from anthracnose or rust spots", "Healthy primocanes and floricanes with plump red aggregate berries"], | |
| "treatment": { | |
| "immediate_action": ["Trellis canes for vertical support; remove old spent floricanes after fruiting"], | |
| "organic_control": ["Mulch with wood chips to keep root zone cool and moist"], | |
| "chemical_control": ["No pesticide application needed."] | |
| }, | |
| "prevention": ["Prune dead canes to ground level every winter"], | |
| "expert_consultation_recommended": False | |
| } | |
| } | |