Update app.py
Browse files
app.py
CHANGED
|
@@ -45,14 +45,15 @@ def predict_stage(image):
|
|
| 45 |
# 7. Return the final formatted string
|
| 46 |
return f"🌾 Predicted Stage: {predicted_label.capitalize()} | Confidence: {confidence:.2f}"
|
| 47 |
|
|
|
|
| 48 |
# Set up the Gradio interface
|
| 49 |
interface = gr.Interface(
|
| 50 |
fn=predict_stage,
|
| 51 |
inputs=gr.Image(type="pil"),
|
| 52 |
outputs="text",
|
| 53 |
-
title="
|
| 54 |
description="Upload a picture of the rice crop from the field to instantly detect its growth stage.",
|
| 55 |
-
|
| 56 |
)
|
| 57 |
|
| 58 |
if __name__ == "__main__":
|
|
|
|
| 45 |
# 7. Return the final formatted string
|
| 46 |
return f"🌾 Predicted Stage: {predicted_label.capitalize()} | Confidence: {confidence:.2f}"
|
| 47 |
|
| 48 |
+
# Set up the Gradio interface
|
| 49 |
# Set up the Gradio interface
|
| 50 |
interface = gr.Interface(
|
| 51 |
fn=predict_stage,
|
| 52 |
inputs=gr.Image(type="pil"),
|
| 53 |
outputs="text",
|
| 54 |
+
title="Rice Crop Growth Stage Classifier",
|
| 55 |
description="Upload a picture of the rice crop from the field to instantly detect its growth stage.",
|
| 56 |
+
flagging_mode="never" # Updated from allow_flagging for Gradio 4 compatibility
|
| 57 |
)
|
| 58 |
|
| 59 |
if __name__ == "__main__":
|