geetu040 commited on
Commit
b95c986
·
1 Parent(s): d36b367
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -21,7 +21,7 @@ def predict(image, color_map):
21
  # apply matplotlib colormap (e.g., viridis)
22
  depth_array = np.array(depth_image) # Convert PIL image to NumPy array
23
  colormap = plt.get_cmap(color_map) # Choose a colormap
24
- depth_colored = colormap(depth_array[:, :, 0] / 255.0) # Normalize and apply colormap
25
  depth_colored = (depth_colored * 255).astype(np.uint8) # Convert to RGB (discard alpha)
26
 
27
  depth_colored = Image.fromarray(depth_colored)
 
21
  # apply matplotlib colormap (e.g., viridis)
22
  depth_array = np.array(depth_image) # Convert PIL image to NumPy array
23
  colormap = plt.get_cmap(color_map) # Choose a colormap
24
+ depth_colored = colormap(depth_array / 255.0) # Normalize and apply colormap
25
  depth_colored = (depth_colored * 255).astype(np.uint8) # Convert to RGB (discard alpha)
26
 
27
  depth_colored = Image.fromarray(depth_colored)