fpramunno commited on
Commit
5d926b5
1 Parent(s): eb240c8

Update diffusion.py

Browse files
Files changed (1) hide show
  1. diffusion.py +2 -2
diffusion.py CHANGED
@@ -86,8 +86,8 @@ class Diffusion_cond:
86
  print('The sampler {} is not implemented'.format(sampling_mode))
87
  break
88
  model.train() # it goes back to training mode
89
- # x = (x.clamp(-1, 1) + 1) / 2 # to be in [-1, 1], the plus 1 and the division by 2 is to bring back values to [0, 1]
90
- # x = (x * 255).type(torch.uint8) # to bring in valid pixel range
91
  return x
92
 
93
  mse = nn.MSELoss()
 
86
  print('The sampler {} is not implemented'.format(sampling_mode))
87
  break
88
  model.train() # it goes back to training mode
89
+ x = (x.clamp(-1, 1) + 1) / 2 # to be in [-1, 1], the plus 1 and the division by 2 is to bring back values to [0, 1]
90
+ x = (x * 255).type(torch.uint8) # to bring in valid pixel range
91
  return x
92
 
93
  mse = nn.MSELoss()