huntrezz commited on
Commit
935e878
·
verified ·
1 Parent(s): 37d103e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,7 +37,7 @@ color_map = cv2.applyColorMap(np.arange(256, dtype=np.uint8), cv2.COLORMAP_INFER
37
  color_map = torch.from_numpy(color_map).to(device)
38
 
39
  def preprocess_image(image):
40
- image = cv2.resize(image, (128, 128))
41
  image = torch.from_numpy(image).permute(2, 0, 1).unsqueeze(0).float().to(device)
42
  return image / 255.0
43
 
@@ -46,7 +46,7 @@ def plot_depth_map(depth_map):
46
  ax = fig.add_subplot(111, projection='3d')
47
  x, y = np.meshgrid(range(depth_map.shape[1]), range(depth_map.shape[0]))
48
  ax.plot_surface(x, y, depth_map, cmap='viridis')
49
- ax.set_zlim(0, 1)
50
  plt.close(fig)
51
  return fig
52
 
 
37
  color_map = torch.from_numpy(color_map).to(device)
38
 
39
  def preprocess_image(image):
40
+ image = cv2.resize(image, (256, 144))
41
  image = torch.from_numpy(image).permute(2, 0, 1).unsqueeze(0).float().to(device)
42
  return image / 255.0
43
 
 
46
  ax = fig.add_subplot(111, projection='3d')
47
  x, y = np.meshgrid(range(depth_map.shape[1]), range(depth_map.shape[0]))
48
  ax.plot_surface(x, y, depth_map, cmap='viridis')
49
+ ax.set_zlim(1, 0)
50
  plt.close(fig)
51
  return fig
52