utils/tf_image_processing.py
def rgb_to_bgr(images, name=None):
  """ Transforms a image tensor from RGB to BGR data format.

  Args:
    images: A tensor of shape (num_images, num_rows, num_columns, num_channels)
       (NHWC), (num_rows, num_columns, num_channels) (HWC), where num_channels
       must be 3.
    name: A name for the operation (optional).

  Returns:
    A Tensor of the same shape like `images`.
  """
  with tf.name_scope(name, 'RgbToBgr', [images]):
    axis = 2 if images.get_shape().ndims == 3 else 3
    r, g, b = tf.split(images, axis=axis, num_or_size_splits=3)
    images = tf.concat(axis=axis, values=[b, g, r])
    return images
 Transforms a image tensor from RGB to BGR data format.

  Args:
    images: A tensor of shape (num_images, num_rows, num_columns, num_channels)
       (NHWC), (num_rows, num_columns, num_channels) (HWC), where num_channels
       must be 3.
    name: A name for the operation (optional).

  Returns:
    A Tensor of the same shape like `images`.
  
Transforms a image tensor from RGB to BGR data format.
Transforms a image tensor from RGB to BGR data format .
def rgb_to_bgr(images, name=None):
  with tf.name_scope(name, 'RgbToBgr', [images]):
    axis = 2 if images.get_shape().ndims == 3 else 3
    r, g, b = tf.split(images, axis=axis, num_or_size_splits=3)
    images = tf.concat(axis=axis, values=[b, g, r])
    return images
def rgb_to_bgr ( images , name = None ) : with tf . name_scope ( name , 'RgbToBgr' , [ images ] ) : axis = 2 if images . get_shape ( ) . ndims == 3 else 3 r , g , b = tf . split ( images , axis = axis , num_or_size_splits = 3 ) images = tf . concat ( axis = axis , values = [ b , g , r ] ) return images
Transforms a image tensor from RGB to BGR data format.
Transforms a image tensor from RGB to BGR data format .
""" Transforms a image tensor from RGB to BGR data format.

  Args:
    images: A tensor of shape (num_images, num_rows, num_columns, num_channels)
       (NHWC), (num_rows, num_columns, num_channels) (HWC), where num_channels
       must be 3.
    name: A name for the operation (optional).

  Returns:
    A Tensor of the same shape like `images`.
  """
A Tensor of the same shape like `images`.
A Tensor of the same shape like ` images ` .
images
A tensor of shape (num_images, num_rows, num_columns, num_channels)
(NHWC), (num_rows, num_columns, num_channels) (HWC), where num_channels
must be 3.
A tensor of shape ( num_images num_rows num_columns num_channels ) ( NHWC ) ( num_rows num_columns num_channels ) ( HWC ) where num_channels must be 3 .
name
A name for the operation (optional).
A name for the operation ( optional ) .