DurgaDeepak commited on
Commit
2ec5667
·
verified ·
1 Parent(s): c7bfbd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -115,6 +115,7 @@ def handle(mode, media_upload, url, run_det, det_model, det_confidence, run_seg,
115
  with gr.Blocks() as demo:
116
  gr.Markdown("## Unified Visual Intelligence System (UVIS)")
117
  with gr.Row():
 
118
  with gr.Column(scale=2):
119
  # Input Mode Toggle
120
  mode = gr.Radio(["Upload", "URL"], value="Upload", label="Input Mode")
@@ -149,20 +150,26 @@ with gr.Blocks() as demo:
149
  run_seg = gr.Checkbox(label="Semantic Segmentation")
150
  run_depth = gr.Checkbox(label="Depth Estimation")
151
 
152
- with gr.Accordion("Object Detection Settings", open=True, visible=False) as OD_Settings:
153
- det_model = gr.Dropdown(choices=list(DETECTION_MODEL_MAP), label="Detection Model")
154
- det_confidence = gr.Slider(0.1, 1.0, 0.5, label="Detection Confidence Threshold")
 
 
155
 
 
 
 
156
 
157
- seg_model = gr.Dropdown(choices=list(SEGMENTATION_MODEL_MAP), label="Segmentation Model", visible=False)
158
- depth_model = gr.Dropdown(choices=list(DEPTH_MODEL_MAP), label="Depth Model", visible=False)
 
159
 
160
 
161
 
162
  # Attach Visibility Logic
163
  run_det.change(fn=toggle_visibility, inputs=[run_det], outputs=[OD_Settings])
164
- run_seg.change(fn=toggle_visibility, inputs=[run_seg], outputs=[seg_model])
165
- run_depth.change(fn=toggle_visibility, inputs=[run_depth], outputs=[depth_model])
166
 
167
 
168
  blend = gr.Slider(0.0, 1.0, 0.5, label="Overlay Blend")
 
115
  with gr.Blocks() as demo:
116
  gr.Markdown("## Unified Visual Intelligence System (UVIS)")
117
  with gr.Row():
118
+ # left panel
119
  with gr.Column(scale=2):
120
  # Input Mode Toggle
121
  mode = gr.Radio(["Upload", "URL"], value="Upload", label="Input Mode")
 
150
  run_seg = gr.Checkbox(label="Semantic Segmentation")
151
  run_depth = gr.Checkbox(label="Depth Estimation")
152
 
153
+ with gr.Row():
154
+ with gr.Column(visible=False) as OD_settings:
155
+ with gr.Accordion("Object Detection Settings", open=True):
156
+ det_model = gr.Dropdown(choices=list(DETECTION_MODEL_MAP), label="Detection Model")
157
+ det_confidence = gr.Slider(0.1, 1.0, 0.5, label="Detection Confidence Threshold")
158
 
159
+ with gr.Column(visible=False) as SS_settings:
160
+ with gr.Accordion("Semantic Segmentation Settings", open=True):
161
+ seg_model = gr.Dropdown(choices=list(SEGMENTATION_MODEL_MAP), label="Segmentation Model")
162
 
163
+ with gr.Column(visible=False) as DE_settings:
164
+ with gr.Accordion("Depth Estimation Settings", open=True):
165
+ depth_model = gr.Dropdown(choices=list(DEPTH_MODEL_MAP), label="Depth Model")
166
 
167
 
168
 
169
  # Attach Visibility Logic
170
  run_det.change(fn=toggle_visibility, inputs=[run_det], outputs=[OD_Settings])
171
+ run_seg.change(fn=toggle_visibility, inputs=[run_seg], outputs=[SS_Settings])
172
+ run_depth.change(fn=toggle_visibility, inputs=[run_depth], outputs=[DE_Settings])
173
 
174
 
175
  blend = gr.Slider(0.0, 1.0, 0.5, label="Overlay Blend")