Spaces:
Runtime error
Runtime error
Commit
·
4921103
1
Parent(s):
c08fbe3
minor fixes to diagnostic message and probability sorting\
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def plant_treatment_message(predicted_string):
|
|
| 77 |
elif predicted_string == "Squash___Powdery_mildew":
|
| 78 |
return "This is a fungal disease that can cause white powdery spots on leaves and fruit. Consider removing infected plant parts and treating with a fungicide."
|
| 79 |
elif predicted_string == "Strawberry___Leaf_scorch":
|
| 80 |
-
return "This can be caused by drought, sunburn, or fungal diseases. Make sure Consider removing infected plant parts and treating with a fungicide."
|
| 81 |
elif predicted_string == "Tomato___Bacterial_spot":
|
| 82 |
return "This is a bacterial disease that can cause spots on leaves and fruit. Consider removing infected plant parts and treating with a copper-based fungicide."
|
| 83 |
elif predicted_string == "Tomato___Early_blight":
|
|
@@ -105,7 +105,6 @@ def clean_prediction(prediction):
|
|
| 105 |
treatment = plant_treatment_message(p['predicted']) if diagnosis is not 'healthy' else None
|
| 106 |
clean_predictions.append([plant, diagnosis, "{0:.1f}%".format(float(p['probability']) * 100), treatment])
|
| 107 |
|
| 108 |
-
clean_predictions.sort(key=lambda x: x[2], reverse=True)
|
| 109 |
return clean_predictions
|
| 110 |
|
| 111 |
def diagnose_health(file):
|
|
|
|
| 77 |
elif predicted_string == "Squash___Powdery_mildew":
|
| 78 |
return "This is a fungal disease that can cause white powdery spots on leaves and fruit. Consider removing infected plant parts and treating with a fungicide."
|
| 79 |
elif predicted_string == "Strawberry___Leaf_scorch":
|
| 80 |
+
return "This can be caused by drought, sunburn, or fungal diseases. Make sure your plant is getting enough water and sunlight. Consider removing infected plant parts and treating with a fungicide."
|
| 81 |
elif predicted_string == "Tomato___Bacterial_spot":
|
| 82 |
return "This is a bacterial disease that can cause spots on leaves and fruit. Consider removing infected plant parts and treating with a copper-based fungicide."
|
| 83 |
elif predicted_string == "Tomato___Early_blight":
|
|
|
|
| 105 |
treatment = plant_treatment_message(p['predicted']) if diagnosis is not 'healthy' else None
|
| 106 |
clean_predictions.append([plant, diagnosis, "{0:.1f}%".format(float(p['probability']) * 100), treatment])
|
| 107 |
|
|
|
|
| 108 |
return clean_predictions
|
| 109 |
|
| 110 |
def diagnose_health(file):
|