(image, means=[_R_MEAN, _G_MEAN, _B_MEAN])
return image
Subtracts the given means from each image channel.

    Returns:
        the centered image.
Subtracts the given means from each image channel.
Subtracts the given means from each image channel .
def tf_image_whitened(image, means=[_R_MEAN, _G_MEAN, _B_MEAN]):
    """Subtracts the given means from each image channel.

    Returns:
        the centered image.
    """
    if image.get_shape().ndims != 3:
        raise ValueError('Input must be of size [height, width, C>0]')
    num_channels = image.get_shape().as_list()[-1]

    if len(means) != num_channels:
        raise ValueError('len(means) must match the number of channels')

    mean = tf.constant(means, dtype=image.dtype)
    image = image - mean
    return image
def tf_image_whitened ( image , means = [ _R_MEAN , _G_MEAN , _B_MEAN ] ) : if image . get_shape ( ) . ndims != 3 : raise ValueError ( 'Input must be of size [height, width, C>0]' ) num_channels = image . get_shape ( ) . as_list ( ) [ - 1 ] if len ( means ) != num_channels : raise ValueError ( 'len(means) must match the number of channels' ) mean = tf . constant ( means , dtype = image . dtype ) image = image - mean return image