fpramunno commited on
Commit
78f112e
1 Parent(s): ffd40df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -44,10 +44,11 @@ def generate_image(seed_image):
44
  elif file_ext.lower() == '.fits':
45
  with fits.open(seed_image) as hdul:
46
  data = hdul[0].data
47
-
48
  input_img_pil = transform_hmi(data).reshape(1, 1, 256, 256).to(device)
 
 
49
 
50
- generated_image = diffusion.sample(model, y=seed_image_tensor, labels=None, n=1)
51
 
52
  inp_img = seed_image_tensor.reshape(1, 256, 256).permute(1, 2, 0)
53
  inp_img = np.squeeze(inp_img.cpu().numpy())
 
44
  elif file_ext.lower() == '.fits':
45
  with fits.open(seed_image) as hdul:
46
  data = hdul[0].data
 
47
  input_img_pil = transform_hmi(data).reshape(1, 1, 256, 256).to(device)
48
+ else:
49
+ print(f'Format {file_ext.lower()} not supported')
50
 
51
+ generated_image = diffusion.sample(model, y=input_img_pil, labels=None, n=1)
52
 
53
  inp_img = seed_image_tensor.reshape(1, 256, 256).permute(1, 2, 0)
54
  inp_img = np.squeeze(inp_img.cpu().numpy())