songweig commited on
Commit
e5985ca
1 Parent(s): 2ca82cc
Files changed (2) hide show
  1. app.py +1 -0
  2. utils/attention_utils.py +0 -2
app.py CHANGED
@@ -79,6 +79,7 @@ def main():
79
  background_aug: bool,
80
  ):
81
  run_dir = 'results/'
 
82
  # Load region diffusion model.
83
  height = int(height)
84
  width = int(width)
 
79
  background_aug: bool,
80
  ):
81
  run_dir = 'results/'
82
+ os.makedirs(run_dir, exist_ok=True)
83
  # Load region diffusion model.
84
  height = int(height)
85
  width = int(width)
utils/attention_utils.py CHANGED
@@ -236,8 +236,6 @@ def get_token_maps(selfattn_maps, crossattn_maps, n_maps, save_dir, width, heigh
236
  fig = plt.figure()
237
  plt.imshow(clusters)
238
  plt.axis('off')
239
- plt.savefig(os.path.join(save_dir, 'segmentation_k%d.jpg' % (num_segments)),
240
- bbox_inches='tight', pad_inches=0)
241
  if return_vis:
242
  canvas = fig.canvas
243
  canvas.draw()
 
236
  fig = plt.figure()
237
  plt.imshow(clusters)
238
  plt.axis('off')
 
 
239
  if return_vis:
240
  canvas = fig.canvas
241
  canvas.draw()