Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
-
|
2 |
-
|
|
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
PLANT_ID_API_KEY = os.getenv("PLANT_ID_API_KEY")
|
9 |
-
print(f"🔍 Loaded API Key: {PLANT_ID_API_KEY}")
|
10 |
-
|
11 |
-
if not PLANT_ID_API_KEY:
|
12 |
-
raise ValueError("❌ API Key is missing! Set PLANT_ID_API_KEY in Hugging Face Secrets or .env file.")
|
|
|
1 |
+
# Launch Gradio App
|
2 |
+
if __name__ == "__main__":
|
3 |
+
import gradio as gr
|
4 |
|
5 |
+
iface = gr.Interface(
|
6 |
+
fn=analyze_plant_health,
|
7 |
+
inputs=gr.Image(type="pil", label="📸 Upload or Capture a Plant Image"),
|
8 |
+
outputs=gr.Textbox(label="🔍 Diagnosis & Treatment"),
|
9 |
+
title="🌿 AI-Powered Plant Disease Detector",
|
10 |
+
description="📷 Upload an image of a plant leaf to detect diseases and get treatment suggestions.",
|
11 |
+
allow_flagging="never"
|
12 |
+
)
|
13 |
|
14 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|