caffe学习笔记(6):读取图片

来源:互联网 发布:nestopia mac 手柄 编辑:程序博客网 时间:2024/06/05 23:03

the paper is to show you how to read paper with python.
two methods will be shown to you.

import syssys.path.insert(0, 'python/')import caffeimport numpy as npimport matplotlib.pyplot as plt%matplotlib inline
# load image use np.array with caffeim = np.array(caffe.io.load_image('./examples/images/cat.jpg', color=True)).squeeze()plt.title("original image")plt.imshow(im)plt.axis('off')plt.show()im.shape

use the ‘color = True/False’ show the gray image or RGB image.

这里写图片描述
(360, 480, 3)

from scipy import miscim=misc.imread('./examples/images/cat.jpg')plt.imshow(im)plt.title("original image")plt.axis('off')plt.show()

这里写图片描述

0 0
原创粉丝点击