self.net.blobs['data'].reshape(1, 3, self.image_resize, self.image_resize)
#image = caffe.io.load_image(image_file)
image = cv2.imread(image_file)
image = cv2.resize(image, (300,300))
img = np.zeros((1,3,300,300))
img[0,0,:,:] = image[:,:,0]-104.0
img[0,1,:,:] = image[:,:,1]-113.0
img[0,2,:,:] = image[:,:,2]-127.0
self.net.blobs['data'].data[...] = img
opencv 代替caffe.io.load_image
最新推荐文章于 2019-11-19 16:30:01 发布