当前位置: 移动技术网 > IT编程>脚本编程>Python > tf读取图片,matplotlib可视化

tf读取图片,matplotlib可视化

2019年09月26日  | 移动技术网IT编程  | 我要评论

酒神阴阳冕,韩国女星潜规则艳照,终极一班2剧情分集介绍

代码:

"""
使用tf读取图片
"""


import tensorflow as tf
import matplotlib.pyplot as plt


image_raw = tf.gfile.fastgfile(r'c:\users\administrator\desktop\meatwice\meatwice\01newcognition\reinforcement_learning\new_test_tensorflow\picture_set\b023260d27ab8087b5b7d73b837094d.png', \
                     'rb').read()

img = tf.image.decode_jpeg(image_raw)

with tf.session() as sess:
    img1 = img.eval()
    # print(img1)
    print(img1.shape)

plt.figure(1)
plt.imshow(img1)
plt.show()

 

显示:

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网