Skip to content

Instantly share code, notes, and snippets.

@mmeendez8
Created January 29, 2019 15:28
Show Gist options
  • Select an option

  • Save mmeendez8/874ea37859b7b93e22ba95dd787335b2 to your computer and use it in GitHub Desktop.

Select an option

Save mmeendez8/874ea37859b7b93e22ba95dd787335b2 to your computer and use it in GitHub Desktop.
def remove_noise(image):
alpha = tf.greater(image[:, :, 3], 50)
alpha = tf.expand_dims(tf.cast(alpha, dtype=tf.uint8), 2)
noise_filtered = tf.multiply(alpha, image)
return noise_filtered[..., :3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment