Created
June 27, 2017 14:14
-
-
Save Noiredd/3aad529fc6e05f094b1a7e682ee94029 to your computer and use it in GitHub Desktop.
additional example for #5173
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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