lukemelas commited on
Commit
59b4598
1 Parent(s): 94e6f4c
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -162,7 +162,7 @@ def segment(inp: Image):
162
  # Arrange eigenvectors into grid
163
  cmap = get_cmap('viridis')
164
  output_images = []
165
- eigenvectors_upscaled = []
166
  for i in range(1, K + 1):
167
  eigenvector = eigenvectors[i].reshape(1, 1, H_patch, W_patch) # .reshape(1, 1, H_pad, W_pad)
168
  eigenvector: torch.Tensor = F.interpolate(eigenvector, size=(H_pad, W_pad), mode='bilinear', align_corners=False) # slightly off, but for visualizations this is okay
@@ -172,7 +172,7 @@ def segment(inp: Image):
172
  eigenvector_vis = Image.open(buffer).convert('RGB')
173
  # eigenvector_vis = TF.to_tensor(eigenvector_vis).unsqueeze(0)
174
  eigenvector_vis = np.array(eigenvector_vis)
175
- eigenvectors_upscaled.append(eigenvector)
176
  output_images.append(eigenvector_vis)
177
  # output_images = torch.cat(output_images, dim=0)
178
  # output_images = make_grid(output_images, nrow=8, pad_value=1)
 
162
  # Arrange eigenvectors into grid
163
  cmap = get_cmap('viridis')
164
  output_images = []
165
+ # eigenvectors_upscaled = []
166
  for i in range(1, K + 1):
167
  eigenvector = eigenvectors[i].reshape(1, 1, H_patch, W_patch) # .reshape(1, 1, H_pad, W_pad)
168
  eigenvector: torch.Tensor = F.interpolate(eigenvector, size=(H_pad, W_pad), mode='bilinear', align_corners=False) # slightly off, but for visualizations this is okay
 
172
  eigenvector_vis = Image.open(buffer).convert('RGB')
173
  # eigenvector_vis = TF.to_tensor(eigenvector_vis).unsqueeze(0)
174
  eigenvector_vis = np.array(eigenvector_vis)
175
+ # eigenvectors_upscaled.append(eigenvector)
176
  output_images.append(eigenvector_vis)
177
  # output_images = torch.cat(output_images, dim=0)
178
  # output_images = make_grid(output_images, nrow=8, pad_value=1)