jays009 commited on
Commit
fb8a03b
·
verified ·
1 Parent(s): b4d05af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -103,3 +103,16 @@ def predict(data):
103
  print(f"Error processing image: {e}")
104
  return json.dumps({"error": f"Error processing image: {e}"})
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  print(f"Error processing image: {e}")
104
  return json.dumps({"error": f"Error processing image: {e}"})
105
 
106
+ # Create the Gradio interface
107
+ iface = gr.Interface(
108
+ fn=predict,
109
+ inputs=gr.JSON(label="Input JSON"),
110
+ outputs=gr.Textbox(label="Prediction Result"),
111
+ live=True,
112
+ title="Maize Anomaly Detection",
113
+ description="Upload an image of maize to detect anomalies like disease or pest infestation. You can provide local paths, URLs, or base64-encoded images."
114
+ )
115
+
116
+ # Launch the Gradio interface
117
+ iface.launch(share=True, show_error=True)
118
+