#tf.image.rot90()与tf.image.flip_up_down()增加原始数据到8倍
#python 3.6
import matplotlib.pyplot as plt
import tensorflow as tf
image_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('o