设为首页 加入收藏

TOP

tf读取图片,matplotlib可视化
2019-09-26 11:11:20 】 浏览:34
Tags:读取 图片 matplotlib 可视化

代码:

"""
使用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.eva l()
    # print(img1)
    print(img1.shape)

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

 

显示:

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇我想要送你资料 @程序猿 测试媛 下一篇Python实现十大经典排序算法(史..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目