ranchopanda0 commited on
Commit
3c8acf4
·
verified ·
1 Parent(s): 7507f29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -1,12 +1,14 @@
1
- import os
2
- from dotenv import load_dotenv
 
3
 
4
- # Load environment variables
5
- load_dotenv()
 
 
 
 
 
 
6
 
7
- # Debug: Print API key (Remove this line after testing)
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()