首页 > 其他 > 详细

tf读取图片,matplotlib可视化

时间:2019-09-26 13:09:31      阅读:111      评论:0      收藏:0      [点我收藏+]

代码:

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


import tensorflow as tf
import matplotlib.pyplot as plt


image_raw = tf.gfile.FastGFile(rC:\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()

 

显示:

技术分享图片

 

tf读取图片,matplotlib可视化

原文:https://www.cnblogs.com/zrmw/p/11589503.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!