#tf.image.rot90()与tf.image.flip_up_down()增加原始数据到8倍
#python 3.6
import matplotlib.pyplot as plt
import tensorflow as tfimage_raw_data = tf.io.gfile.GFile(r'./data/IMG/TaylorSwift.jpg','rb').read()with tf.compat.v1.Session() as sess:img_data = tf.image.decode_jpeg(image_raw_data)#img_data = tf.image.decode_png(image_raw_data) print(img_data.eval())plt.subplot(2,4,1)plt.imshow(img_data.eval())plt.axis('off')rotate_r90 = tf.image.rot90(img_data ,k=1)plt.subplot(2,4,2)plt.imshow(rotate_r90.eval())plt.axis('off')rotate_r180 = tf.image.rot90(img_data ,k=2)plt.subplot(2,4,3)plt.imshow(rotate_r180.eval())plt.axis('off')rotate_r270 = tf.image.rot90(img_data ,k=3)plt.subplot(2,4,4)plt.imshow(rotate_r270.eval())plt.axis('off')img_data1= tf.image.flip_up_down(img_data)plt.subplot(2,4,5)plt.imshow(img_data1.eval())plt.axis('off')rotate_l90 = tf.image.rot90(img_data1 ,k=1)plt.subplot(2,4,6)plt.imshow(rotate_l90.eval())plt.axis('off')rotate_l180 = tf.image.rot90(img_data1 ,k=2)plt.subplot(2,4,7)plt.imshow(rotate_l180.eval())plt.axis('off')rotate_l270 = tf.image.rot90(img_data1 ,k=3)plt.subplot(2,4,8)plt.imshow(rotate_l270.eval())plt.axis('off')plt.show()