Ritvik Shrivastava commited on
Commit
80a4e51
Β·
1 Parent(s): 531d024

minor changes pt5!

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -23,7 +23,7 @@ def analyze_image(image: Image.Image, language: str) -> dict:
23
  trace_logger.save_trace(session)
24
  return report
25
 
26
- def analyze_and_render(image):
27
  if image is None:
28
  return "<p style='color:#6b7280;padding:20px'>Please upload or take a photo first.</p>"
29
  r = analyze_image(image, language)
@@ -115,7 +115,12 @@ footer { display: none !important; }
115
 
116
  # ── UI ──────────────────────────────────────────────────────────────────────────
117
  with gr.Blocks(
 
118
  title="GharScan β€” Building Defect Inspector",
 
 
 
 
119
  ) as demo:
120
  gr.HTML("""
121
  <div style='display:flex;align-items:center;justify-content:space-between;
@@ -153,7 +158,7 @@ with gr.Blocks(
153
 
154
  analyze_btn.click(
155
  fn=analyze_and_render,
156
- inputs=[image_input],
157
  outputs=report_output,
158
  api_name="analyze"
159
  )
@@ -169,10 +174,4 @@ with gr.Blocks(
169
  """)
170
 
171
  demo.queue()
172
- demo.launch(
173
- css=CSS,
174
- theme=gr.themes.Base(
175
- primary_hue="blue",
176
- neutral_hue="slate",
177
- )
178
- )
 
23
  trace_logger.save_trace(session)
24
  return report
25
 
26
+ def analyze_and_render(image, language):
27
  if image is None:
28
  return "<p style='color:#6b7280;padding:20px'>Please upload or take a photo first.</p>"
29
  r = analyze_image(image, language)
 
115
 
116
  # ── UI ──────────────────────────────────────────────────────────────────────────
117
  with gr.Blocks(
118
+ css=CSS,
119
  title="GharScan β€” Building Defect Inspector",
120
+ theme=gr.themes.Base(
121
+ primary_hue="blue",
122
+ neutral_hue="slate",
123
+ )
124
  ) as demo:
125
  gr.HTML("""
126
  <div style='display:flex;align-items:center;justify-content:space-between;
 
158
 
159
  analyze_btn.click(
160
  fn=analyze_and_render,
161
+ inputs=[image_input, language],
162
  outputs=report_output,
163
  api_name="analyze"
164
  )
 
174
  """)
175
 
176
  demo.queue()
177
+ demo.launch()