huntrezz commited on
Commit
532c480
·
verified ·
1 Parent(s): d9f925f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -52,9 +52,8 @@ def process_frame(image):
52
  depth_map = (depth_map - depth_map.min()) / (depth_map.max() - depth_map.min())
53
  depth_map = (depth_map * 255).byte()
54
 
55
- # Reshape depth_map to match color_map dimensions
56
- depth_map = depth_map.view(-1)
57
- depth_map_colored = color_map[depth_map].view(96, 128, 3)
58
 
59
  return cv2.cvtColor(depth_map_colored.cpu().numpy(), cv2.COLOR_BGR2RGB)
60
 
 
52
  depth_map = (depth_map - depth_map.min()) / (depth_map.max() - depth_map.min())
53
  depth_map = (depth_map * 255).byte()
54
 
55
+ # Apply color map
56
+ depth_map_colored = color_map[depth_map].squeeze()
 
57
 
58
  return cv2.cvtColor(depth_map_colored.cpu().numpy(), cv2.COLOR_BGR2RGB)
59