(image)
return tf.multiply(n, n_str)
Add poisson noise.

    This function approximate posson noise upto 2nd order.
    Assume images were in 0-255, and converted to the range of -1 to 1.
Add poisson noise.
Add poisson noise .
def get_possion_noise(image):
    """Add poisson noise.

    This function approximate posson noise upto 2nd order.
    Assume images were in 0-255, and converted to the range of -1 to 1.
    """
    n = tf.random_normal(shape=tf.shape(image), mean=0.0, stddev=1.0)
    # strength ~ sqrt image value in 255, divided by 127.5 to convert
    # back to -1, 1 range.
    n_str = tf.sqrt(image + 1.0) / np.sqrt(127.5)
    return tf.multiply(n, n_str)
def get_possion_noise ( image ) : n = tf . random_normal ( shape = tf . shape ( image ) , mean = 0.0 , stddev = 1.0 ) # strength ~ sqrt image value in 255, divided by 127.5 to convert # back to -1, 1 range. n_str = tf . sqrt ( image + 1.0 ) / np . sqrt ( 127.5 ) return tf . multiply ( n , n_str )