title: Blur and Motion Blur augmentation
body: <p>I am using Deeplabv3+ repository and I would like to know how do you apply Motion Blur and Blur as augmentation. I have a few augmentations already, like random scale (example).</p>
  
  <p>However, I could not find any out of the box solution to apply Motion Blur on tensorflow.
  Does anyone know any library or how to build this transformation?</p>
  
  <pre><code>def randomly_scale_image_and_label(image, label=None, scale=1.0):
    """Randomly scales image and label.
  
    Args:
      image: Image with shape [height, width, 3].
      label: Label with shape [height, width, 1].
      scale: The value to scale image and label.
  
    Returns:
      Scaled image and label.
    """
    # No random scaling if scale == 1.
    if scale == 1.0:
      return image, label
    image_shape = tf.shape(image)
    new_dim = tf.cast(
        tf.cast([image_shape[0], image_shape[1]], tf.float32) * scale,
        tf.int32)
  
    # Need squeeze and expand_dims because image interpolation takes
    # 4D tensors as input.
    image = tf.squeeze(tf.image.resize_bilinear(
        tf.expand_dims(image, 0),
        new_dim,
        align_corners=True), [0])
    if label is not None:
      label = tf.squeeze(tf.image.resize_nearest_neighbor(
          tf.expand_dims(label, 0),
          new_dim,
          align_corners=True), [0])
  
    return image, label
  </code></pre>