Skip to content

Instantly share code, notes, and snippets.

@Noiredd
Created June 27, 2017 14:14
Show Gist options
  • Save Noiredd/3aad529fc6e05f094b1a7e682ee94029 to your computer and use it in GitHub Desktop.
Save Noiredd/3aad529fc6e05f094b1a7e682ee94029 to your computer and use it in GitHub Desktop.
additional example for #5173
from skimage.transform import rescale
import numpy as np
import caffe
inputArray = np.array( [[0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1]] )
scikitResult = rescale(inputArray, scale=2, mode='constant', cval=0)
net = caffe.Net('5173_vsScikit.pt', caffe.TRAIN)
net.blobs['data'].data[0][0][...] = inputArray
net.forward()
caffeResult = net.blobs['x2'].data[0]
print caffeResult.shape
print scikitResult.shape
print caffeResult
print scikitResult
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment