Fahimeh Orvati Nia commited on
Commit
d807150
·
1 Parent(s): dffab99

update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -18,10 +18,20 @@ def process(image):
18
  return [outputs[k] for k in order if k in outputs]
19
 
20
  with gr.Blocks() as demo:
21
- gr.Markdown("# 🌿 Sorghum Single-Image Demo")
22
- inp = gr.Image(type="pil", label="Upload Image")
23
- run = gr.Button("Run Pipeline", variant="primary")
24
- gallery = gr.Gallery(label="Outputs")
 
 
 
 
 
 
 
 
 
 
25
  run.click(process, inputs=inp, outputs=gallery)
26
 
27
  if __name__ == "__main__":
 
18
  return [outputs[k] for k in order if k in outputs]
19
 
20
  with gr.Blocks() as demo:
21
+ gr.Markdown("# 🌿 Sorghum Plant Analysis Demo")
22
+ gr.Markdown("Upload a sorghum plant image to analyze vegetation indices, texture features, and morphology.")
23
+
24
+ with gr.Row():
25
+ with gr.Column():
26
+ inp = gr.Image(type="pil", label="Upload Image")
27
+ run = gr.Button("Run Pipeline", variant="primary")
28
+ with gr.Column():
29
+ preview = gr.Image(type="pil", label="Uploaded Image Preview", interactive=False)
30
+
31
+ gallery = gr.Gallery(label="Analysis Results", columns=3, height="auto")
32
+
33
+ # Update preview when image is uploaded
34
+ inp.change(fn=lambda x: x, inputs=inp, outputs=preview)
35
  run.click(process, inputs=inp, outputs=gallery)
36
 
37
  if __name__ == "__main__":