JanaAlbader commited on
Commit
f8e41d3
1 Parent(s): c3d0fc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -176,20 +176,9 @@ def process_text_input(plant_name=None, language='english'):
176
  audio_file = text_to_speech(plant_fact, language='ar' if language == 'arabic' else 'en')
177
 
178
  return plant_name, care_instructions, audio_file
179
-
180
- def process_image_input(image, language):
181
- plant_type = classify_plant_image(image)
182
- care_instructions = get_care_instructions(plant_type, language)
183
- audio_fact = generate_audio_fact(plant_type, language)
184
- return (f"<span style='color:green;'>{plant_type}</span>", care_instructions, audio_fact)
185
-
186
  # Creating Gradio app with tabs
187
  with gr.Blocks() as demo:
188
- gr.Markdown("""
189
- <div style="background-image: url('/WhatsApp Image 2024-10-01 at 8.01.38 PM.jpeg'); background-size: cover; padding: 20px;">
190
- <h1 style="color:white;">Plant Identification and Care Instructions</h1>
191
- </div>
192
- """)
193
 
194
  with gr.Tab("Image Input"):
195
  gr.Interface(
@@ -199,7 +188,7 @@ with gr.Blocks() as demo:
199
  gr.Dropdown(choices=["english", "arabic"], label="Select Language", value="english") # Language selection
200
  ],
201
  outputs=[
202
- gr.HTML(label="Identified Plant"), # Changed from Textbox to HTML for green text
203
  gr.Textbox(label="Care Instructions"),
204
  gr.Audio(label="Audio Fact") # Output audio file
205
  ],
 
176
  audio_file = text_to_speech(plant_fact, language='ar' if language == 'arabic' else 'en')
177
 
178
  return plant_name, care_instructions, audio_file
 
 
 
 
 
 
 
179
  # Creating Gradio app with tabs
180
  with gr.Blocks() as demo:
181
+ gr.Markdown("## Plant Identification and Care Instructions")
 
 
 
 
182
 
183
  with gr.Tab("Image Input"):
184
  gr.Interface(
 
188
  gr.Dropdown(choices=["english", "arabic"], label="Select Language", value="english") # Language selection
189
  ],
190
  outputs=[
191
+ gr.Textbox(label="Identified Plant"),
192
  gr.Textbox(label="Care Instructions"),
193
  gr.Audio(label="Audio Fact") # Output audio file
194
  ],