freealise commited on
Commit
0f98e12
1 Parent(s): 683d0ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -267,13 +267,18 @@ def get_mesh(image, depth):
267
  def loadurl(url):
268
  return url
269
 
 
 
 
270
  def select_frame(evt: gr.SelectData):
271
  if evt.index != depth_selected:
 
272
  depth_selected = evt.index
273
  return gr.Gallery(selected_index=evt.index, preview=True)
274
 
275
  def select_depth(evt: gr.SelectData):
276
  if evt.index != frame_selected:
 
277
  frame_selected = evt.index
278
  return gr.Gallery(selected_index=evt.index, preview=True)
279
 
@@ -328,8 +333,6 @@ with gr.Blocks(css=css) as demo:
328
  output_depth = gr.Gallery(label="Depth", type='numpy', preview=True, columns=8192)
329
  output_frame.select(fn=select_frame, inputs=None, outputs=[output_depth])
330
  output_depth.select(fn=select_depth, inputs=None, outputs=[output_frame])
331
- frame_selected = 0
332
- depth_selected = 0
333
  submit = gr.Button("Submit")
334
  with gr.Column():
335
  model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')
 
267
  def loadurl(url):
268
  return url
269
 
270
+ frame_selected = 0
271
+ depth_selected = 0
272
+
273
  def select_frame(evt: gr.SelectData):
274
  if evt.index != depth_selected:
275
+ print(output_frame.selected_index)
276
  depth_selected = evt.index
277
  return gr.Gallery(selected_index=evt.index, preview=True)
278
 
279
  def select_depth(evt: gr.SelectData):
280
  if evt.index != frame_selected:
281
+ print(output_depth.selected_index)
282
  frame_selected = evt.index
283
  return gr.Gallery(selected_index=evt.index, preview=True)
284
 
 
333
  output_depth = gr.Gallery(label="Depth", type='numpy', preview=True, columns=8192)
334
  output_frame.select(fn=select_frame, inputs=None, outputs=[output_depth])
335
  output_depth.select(fn=select_depth, inputs=None, outputs=[output_frame])
 
 
336
  submit = gr.Button("Submit")
337
  with gr.Column():
338
  model_type = gr.Dropdown([("small", "vits"), ("base", "vitb"), ("large", "vitl")], type="value", value="vits", label='Model Type')