Spaces:
Sleeping
Sleeping
| """ | |
| Configuration file for Plant Disease Detection UI | |
| Contains class names, paths, and other settings | |
| """ | |
| # PlantVillage dataset has 39 classes | |
| CLASS_NAMES = [ | |
| "Apple___Apple_scab", | |
| "Apple___Black_rot", | |
| "Apple___Cedar_apple_rust", | |
| "Apple___healthy", | |
| "Blueberry___healthy", | |
| "Cherry_(including_sour)___Powdery_mildew", | |
| "Cherry_(including_sour)___healthy", | |
| "Corn_(maize)___Cercospora_leaf_spot Gray_leaf_spot", | |
| "Corn_(maize)___Common_rust_", | |
| "Corn_(maize)___Northern_Leaf_Blight", | |
| "Corn_(maize)___healthy", | |
| "Grape___Black_rot", | |
| "Grape___Esca_(Black_Measles)", | |
| "Grape___Leaf_blight_(Isariopsis_Leaf_Spot)", | |
| "Grape___healthy", | |
| "Orange___Haunglongbing_(Citrus_greening)", | |
| "Peach___Bacterial_spot", | |
| "Peach___healthy", | |
| "Pepper,_bell___Bacterial_spot", | |
| "Pepper,_bell___healthy", | |
| "Potato___Early_blight", | |
| "Potato___Late_blight", | |
| "Potato___healthy", | |
| "Raspberry___healthy", | |
| "Soybean___healthy", | |
| "Squash___Powdery_mildew", | |
| "Strawberry___Leaf_scorch", | |
| "Strawberry___healthy", | |
| "Tomato___Bacterial_spot", | |
| "Tomato___Early_blight", | |
| "Tomato___Late_blight", | |
| "Tomato___Leaf_Mold", | |
| "Tomato___Septoria_leaf_spot", | |
| "Tomato___Spider_mites Two-spotted_spider_mite", | |
| "Tomato___Target_Spot", | |
| "Tomato___Tomato_Yellow_Leaf_Curl_Virus", | |
| "Tomato___Tomato_mosaic_virus", | |
| "Tomato___healthy" | |
| ] | |
| # Model configurations | |
| MODEL_CONFIGS = { | |
| "CNN from Scratch": { | |
| "description": "Custom CNN model trained from scratch", | |
| "input_size": (256, 256), | |
| "model_type": "cnn" | |
| }, | |
| "Transfer Learning (ResNet18)": { | |
| "description": "Fine-tuned ResNet18 model", | |
| "input_size": (256, 256), | |
| "model_type": "resnet18" | |
| } | |
| } | |
| # Image preprocessing settings | |
| IMAGE_SIZE = (256, 256) | |
| NORMALIZE_MEAN = [0.485, 0.456, 0.406] # ImageNet mean | |
| NORMALIZE_STD = [0.229, 0.224, 0.225] # ImageNet std | |
| # UI settings | |
| TOP_K_PREDICTIONS = 10 | |
| CONFIDENCE_THRESHOLD = 0.01 # Minimum confidence to display | |
| # Paths (will be updated when integrating with real model) | |
| MODEL_PATH = "models/best_model.pth" | |
| EXAMPLES_PATH = "ui/examples/" | |
| # ClearML settings (for fetching model from ClearML) | |
| CLEARML_PROJECT_NAME = "Plant Disease Detection" | |
| CLEARML_TASK_NAME = "CNN Training" | |