Skip to content

Commit

Permalink
adding random uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
cheind committed Aug 20, 2018
1 parent 5217f59 commit 192968b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions style/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def new_random_white(shape, mean=None, sigma=1e-2):
img = np.clip(mean + white_noise(shape, sigma), 0, 1).astype(np.float32)
return to_image(img)

def new_random_range(shape, low=0, high=0.95):
return to_image(np.random.uniform(low, high, size=shape).astype(np.float32))

def save(fname, x):
to_pil(x).save(fname)

Expand Down

0 comments on commit 192968b

Please sign in to comment.