preprocessor.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:tefla 作者: openAGI 项目源码 文件源码
def random_adjust_hue(image, max_delta=0.02):
    """Randomly adjusts hue.

    Makes sure the output image is still between 0 and 1.

    Args:
      image: rank 3 float32 tensor contains 1 image -> [height, width, channels]
             with pixel values varying between [0, 1].
      max_delta: change hue randomly with a value between 0 and max_delta.

    Returns:
      image: image which is the same shape as input image.
    """
    with tf.name_scope('RandomAdjustHue', values=[image]):
        image = tf.image.random_hue(image, max_delta)
        image = tf.clip_by_value(image, clip_value_min=0.0, clip_value_max=1.0)
        return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号