Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,17 +34,7 @@ def predict_disease(image_file, model, all_labels, target_language):
|
|
| 34 |
# Predict the class
|
| 35 |
predictions = model.predict(img_array)
|
| 36 |
predictions = model.predict(img_array)
|
| 37 |
-
|
| 38 |
-
confidence_scores = predictions[0]
|
| 39 |
-
max_confidence = np.max(confidence_scores)
|
| 40 |
-
|
| 41 |
-
if max_confidence < confidence_threshold:
|
| 42 |
-
print(f"Prediction confidence ({max_confidence:.2f}) is too low.")
|
| 43 |
-
return f"""
|
| 44 |
-
<h3 style="color:red; text-align:center;">
|
| 45 |
-
Please upload a clearer image of the plant.
|
| 46 |
-
</h3>
|
| 47 |
-
"""
|
| 48 |
predicted_class = np.argmax(predictions[0])
|
| 49 |
|
| 50 |
# Get the predicted class label
|
|
|
|
| 34 |
# Predict the class
|
| 35 |
predictions = model.predict(img_array)
|
| 36 |
predictions = model.predict(img_array)
|
| 37 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
predicted_class = np.argmax(predictions[0])
|
| 39 |
|
| 40 |
# Get the predicted class label
|