freealise commited on
Commit
2021e3d
1 Parent(s): 8352cf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -225,7 +225,8 @@ def pano_depth_to_world_points(depth, scale):
225
  def rgb2gray(rgb):
226
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
227
 
228
- def get_mesh(image, depth, fnum):
 
229
  gdepth = rgb2gray(depth[fnum][0])
230
  print('depth to gray - ok')
231
  points = pano_depth_to_world_points(gdepth, 1)
@@ -338,7 +339,7 @@ with gr.Blocks(css=css) as demo:
338
  return output_video_path
339
 
340
  submit.click(on_submit, inputs=[input_video, model_type], outputs=[processed_video, processed_zip, output_frame, output_depth])
341
- render.click(partial(get_mesh), inputs=[output_frame, output_depth, frame_n], outputs=[result])
342
 
343
  example_files = os.listdir('examples')
344
  example_files.sort()
 
225
  def rgb2gray(rgb):
226
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
227
 
228
+ def get_mesh(image, depth):
229
+ fnum = output_frame.selected_index
230
  gdepth = rgb2gray(depth[fnum][0])
231
  print('depth to gray - ok')
232
  points = pano_depth_to_world_points(gdepth, 1)
 
339
  return output_video_path
340
 
341
  submit.click(on_submit, inputs=[input_video, model_type], outputs=[processed_video, processed_zip, output_frame, output_depth])
342
+ render.click(partial(get_mesh), inputs=[output_frame, output_depth], outputs=[result])
343
 
344
  example_files = os.listdir('examples')
345
  example_files.sort()