huntrezz commited on
Commit
d4f8b39
·
verified ·
1 Parent(s): 56812e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -50,11 +50,14 @@ def process_frame(image):
50
  depth_map = manual_normalize(depth_map)
51
 
52
  depth_map_colored = cv2.applyColorMap(depth_map, color_map)
53
- return cv2.cvtColor(depth_map_colored, cv2.COLOR_BGR2RGB)
 
 
 
54
 
55
  interface = gr.Interface(
56
  fn=process_frame,
57
- inputs=gr.Image(sources="webcam", streaming=True),
58
  outputs="image",
59
  live=True
60
  )
 
50
  depth_map = manual_normalize(depth_map)
51
 
52
  depth_map_colored = cv2.applyColorMap(depth_map, color_map)
53
+ depth_map_colored = cv2.resize(depth_map_colored, (image.shape[1], image.shape[0]))
54
+
55
+ combined = np.hstack((image, depth_map_colored))
56
+ return cv2.cvtColor(combined, cv2.COLOR_BGR2RGB)
57
 
58
  interface = gr.Interface(
59
  fn=process_frame,
60
+ inputs=gr.Image(source="webcam", streaming=True),
61
  outputs="image",
62
  live=True
63
  )