Skip to content

Instantly share code, notes, and snippets.

@ArnoutDevos
Created January 8, 2018 11:35
Show Gist options
  • Save ArnoutDevos/84d5e1d3c93e781bae71d0c900292bb3 to your computer and use it in GitHub Desktop.
Save ArnoutDevos/84d5e1d3c93e781bae71d0c900292bb3 to your computer and use it in GitHub Desktop.
def generate_noise_image(content_image, noise_ratio):
noise_image = np.random.randn(IMAGE_HEIGHT, IMAGE_WIDTH, COLOR_CHANNELS)
#Take a weighted average of the values
gen_image = noise_image * noise_ratio + content_image * (1.0 - noise_ratio)
return gen_image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment