Tensorflow-图像预处理
2017-10-30 17:00
127 查看
参考:https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10/cifar10_input.py
def Image_processing(reshaped_image,height, width): ''' 图像预处理 参考:https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10/cifar10_input.py :return: ''' # Image processing for training the network. Note the many random # distortions applied to the image. # Randomly crop a [height, width] section of the image. distorted_image = tf.random_crop(reshaped_image, [height, width, 3]) # Randomly flip the image horizontally. distorted_image = tf.image.random_flip_left_right(distorted_image) # Because these operations are not commutative, consider randomizing # the order their operation. # NOTE: since per_image_standardization zeros the mean and makes # the stddev unit, this likely has no effect see tensorflow#1458. distorted_image = tf.image.random_brightness(distorted_image, max_delta=63) distorted_image = tf.image.random_contrast(distorted_image, lower=0.2, upper=1.8) # Subtract off the mean and divide by the variance of the pixels. float_image = tf.image.per_image_standardization(distorted_image) # Set the shapes of tensors. return float_image.set_shape([height, width, 3])
相关文章推荐
- TensorFlow图像处理
- tensorflow 图像数据处理(一)
- Tensorflow中图像处理函数
- TensorFlow 实战(五)—— 图像预处理
- TensorFlow:实战Google深度学习框架(六)图像数据处理
- TensorFlow学习笔记-图像预处理
- python使用TensorFlow进行图像处理的方法
- Tensorflow 图像处理函数
- TensorFlow学习--tensorflow图像处理--图像翻转及大小色彩调整
- 如何用TensorFlow图像处理函数裁剪图像?
- TensorFlow学习--tensorflow图像处理--随机调整亮度/对比度/饱和度/色相
- tensorflow 图像数据处理(二)
- TensorFlow图像数据处理
- 【图像处理】Tensorflow:简易超分辨重建与坑
- Tensorflow图像编码处理
- 12、TensorFlow 图像处理
- tensorflow 图像数据处理
- TensorFlow 图像处理和解码操作函数概述
- 在TensorFlow中使用深度学习GANs处理图像
- 如何用TensorFlow图像处理函数裁剪图像?