Annonymous commited on
Commit
3d52de0
1 Parent(s): d54c0f8

Update methods.py

Browse files
Files changed (1) hide show
  1. methods.py +1 -1
methods.py CHANGED
@@ -262,7 +262,7 @@ def get_difference(ssl_model, baseline, image, lr, l2_weight, alpha_weight, alph
262
 
263
  def create_mixed_images(transform_type, ig_transforms, step, img_path, add_noise):
264
 
265
- img = Image.open(img_path).convert('RGB')
266
  img1 = ig_transforms['pure'](img).unsqueeze(0).to(device)
267
  img2 = ig_transforms[transform_type](img).unsqueeze(0).to(device)
268
 
 
262
 
263
  def create_mixed_images(transform_type, ig_transforms, step, img_path, add_noise):
264
 
265
+ img = Image.open(img_path).convert('RGB') if isinstance(img_path, str) else img_path
266
  img1 = ig_transforms['pure'](img).unsqueeze(0).to(device)
267
  img2 = ig_transforms[transform_type](img).unsqueeze(0).to(device)
268