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

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

import sys
sys.path.insert(0, 'python/')
import caffe
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# load image use np.array with caffe
im = 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.

caffe学习笔记(6):读取图片_第1张图片
(360, 480, 3)

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

caffe学习笔记(6):读取图片_第2张图片

你可能感兴趣的:(deep,learning,python)