pablovela5620 commited on
Commit
769aece
·
verified ·
1 Parent(s): fa35929

Upload gradio_app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. gradio_app.py +8 -2
gradio_app.py CHANGED
@@ -90,7 +90,7 @@ def load_models(
90
 
91
 
92
  @rr.thread_local_stream("depth")
93
- def on_submit(rgb: UInt8[np.ndarray, "h w 3"]):
94
  stream: rr.BinaryStream = rr.binary_stream()
95
  models_list = [MODEL_1, MODEL_2]
96
  blueprint = create_depth_comparison_blueprint(models_list)
@@ -115,6 +115,7 @@ def on_submit(rgb: UInt8[np.ndarray, "h w 3"]):
115
  parent_log_path=parent_log_path,
116
  relative_pred=relative_pred,
117
  rgb_hw3=rgb,
 
118
  )
119
 
120
  yield stream.read()
@@ -141,6 +142,11 @@ with gr.Blocks() as demo:
141
  value="Scale | Shift Invariant",
142
  interactive=True,
143
  )
 
 
 
 
 
144
  with gr.Row():
145
  model_1_dropdown = gr.Dropdown(
146
  choices=list(get_args(RELATIVE_PREDICTORS)),
@@ -165,7 +171,7 @@ with gr.Blocks() as demo:
165
 
166
  submit.click(
167
  on_submit,
168
- inputs=[input_image],
169
  outputs=[rr_viewer],
170
  )
171
 
 
90
 
91
 
92
  @rr.thread_local_stream("depth")
93
+ def on_submit(rgb: UInt8[np.ndarray, "h w 3"], remove_flying_pixels: bool):
94
  stream: rr.BinaryStream = rr.binary_stream()
95
  models_list = [MODEL_1, MODEL_2]
96
  blueprint = create_depth_comparison_blueprint(models_list)
 
115
  parent_log_path=parent_log_path,
116
  relative_pred=relative_pred,
117
  rgb_hw3=rgb,
118
+ remove_flying_pixels=remove_flying_pixels,
119
  )
120
 
121
  yield stream.read()
 
142
  value="Scale | Shift Invariant",
143
  interactive=True,
144
  )
145
+ remove_flying_pixels = gr.Checkbox(
146
+ label="Remove Flying Pixels",
147
+ value=True,
148
+ interactive=True,
149
+ )
150
  with gr.Row():
151
  model_1_dropdown = gr.Dropdown(
152
  choices=list(get_args(RELATIVE_PREDICTORS)),
 
171
 
172
  submit.click(
173
  on_submit,
174
+ inputs=[input_image, remove_flying_pixels],
175
  outputs=[rr_viewer],
176
  )
177