freealise commited on
Commit
e673b34
1 Parent(s): f1855ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -234,12 +234,15 @@ def pano_depth_to_world_points(depth):
234
  def rgb2gray(rgb):
235
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
236
 
237
- def get_mesh(image, depth, blur_data, loadall):
238
  global locations
239
  global mesh
240
  if loadall == False:
241
  mesh = []
242
 
 
 
 
243
  fnum = frame_selected
244
  blur_img = blur_image(image[fnum][0], depth[fnum][0], blur_data)
245
 
@@ -728,7 +731,7 @@ with gr.Blocks(css=css) as demo:
728
  return output_video_path + (locations,)
729
 
730
  submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
731
- render.click(partial(get_mesh), inputs=[output_frame, output_depth, blur_in, load_all], outputs=[result])
732
 
733
  example_files = os.listdir('examples')
734
  example_files.sort()
 
234
  def rgb2gray(rgb):
235
  return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
236
 
237
+ def get_mesh(image, blur_data, loadall):
238
  global locations
239
  global mesh
240
  if loadall == False:
241
  mesh = []
242
 
243
+ imgs = np.array_split(image, 2)
244
+ image = imgs[0]
245
+ depth = imgs[1]
246
  fnum = frame_selected
247
  blur_img = blur_image(image[fnum][0], depth[fnum][0], blur_data)
248
 
 
731
  return output_video_path + (locations,)
732
 
733
  submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
734
+ render.click(partial(get_mesh), inputs=[output_frame, blur_in, load_all], outputs=[result])
735
 
736
  example_files = os.listdir('examples')
737
  example_files.sort()