umuthopeyildirim commited on
Commit
ea57a04
·
1 Parent(s): dccb91c

Refactor image processing in app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -103,13 +103,10 @@ with gr.Blocks(css=css) as demo:
103
  pred_depths_r_list[-1], pred_depths_r_list_flipped[-1])
104
 
105
  pred_depth = pred_depth.cpu().numpy().squeeze()
106
- colored_depth = cv2.applyColorMap(
107
- pred_depth, cv2.COLORMAP_INFERNO)[:, :, ::-1]
108
-
109
  tmp = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
110
  pred_depth.save(tmp.name)
111
 
112
- return [(original_image, colored_depth), tmp.name]
113
 
114
  submit.click(on_submit, inputs=[input_image], outputs=[
115
  depth_image_slider, raw_file])
 
103
  pred_depths_r_list[-1], pred_depths_r_list_flipped[-1])
104
 
105
  pred_depth = pred_depth.cpu().numpy().squeeze()
 
 
 
106
  tmp = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
107
  pred_depth.save(tmp.name)
108
 
109
+ return [(original_image, pred_depth), tmp.name]
110
 
111
  submit.click(on_submit, inputs=[input_image], outputs=[
112
  depth_image_slider, raw_file])