AlekseyCalvin commited on
Commit
fc65d85
·
verified ·
1 Parent(s): 0f413ad

Update utils8.py

Browse files
Files changed (1) hide show
  1. utils8.py +1 -0
utils8.py CHANGED
@@ -109,6 +109,7 @@ def anim_frame_warp_2d(prev_img, args, border_mode_str):
109
  def add_noise(img, noise_amt):
110
  if noise_amt <= 0: return img
111
  img_np = np.array(img).astype(np.float32)
 
112
  noise = np.random.normal(0, noise_amt * 255, img_np.shape).astype(np.float32)
113
  noisy = np.clip(img_np + noise, 0, 255).astype(np.uint8)
114
  return Image.fromarray(noisy)
 
109
  def add_noise(img, noise_amt):
110
  if noise_amt <= 0: return img
111
  img_np = np.array(img).astype(np.float32)
112
+ # np.random.normal will use the seed set in the engine loop
113
  noise = np.random.normal(0, noise_amt * 255, img_np.shape).astype(np.float32)
114
  noisy = np.clip(img_np + noise, 0, 255).astype(np.uint8)
115
  return Image.fromarray(noisy)