You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when I do so, the result is significantly worse as the ones shown in the paper. In fact, they do not seem anything better than some Sobel-like filter. Morover, there is a 35-pixel top-left padding in the output that is awkward and mentioned in several other issues as well.
My code is based on the example notebook . My caffe version is 1.0.0.
from matplotlib import pyplot
from skimage.io import imread
import caffe
import numpy
image = imread('paper-example.jpg')
def preprocess_input(X):
X = numpy.array(X, dtype=numpy.float32)
X = X[...,::-1]
X -= numpy.array([[[[104.00698793,116.66876762,122.67891434]]]])
return X.transpose(0, 3, 1, 2) / 128
images = image[None] # images is a 1 x height x width x 3 ndarray
preprocessed = preprocess_input(images) # preprocessed is a 1 x 3 x height x width ndarray
net = caffe.Net(
'deploy.prototxt',
'hed_pretrained_bsds.caffemodel',
caffe.TEST
)
net.blobs['data'].reshape(*preprocessed.shape)
net.blobs['data'].data[...] = preprocessed
net.forward()
out1 = net.blobs['sigmoid-dsn1'].data[0][0]
out2 = net.blobs['sigmoid-dsn2'].data[0][0]
out3 = net.blobs['sigmoid-dsn3'].data[0][0]
out4 = net.blobs['sigmoid-dsn4'].data[0][0]
out5 = net.blobs['sigmoid-dsn5'].data[0][0]
fuse = net.blobs['sigmoid-fuse'].data[0][0]
pyplot.rcParams['figure.figsize'] = (9, 10)
for axis, out, title in zip(
pyplot.subplots(3,2)[1].ravel(),
[out1, out2, out3, out4, out5, fuse],
['out1', 'out2', 'out3', 'out4', 'out5', 'fuse'],
):
if out is not None:
axis.imshow(out)
axis.set_xticks([])
axis.set_yticks([])
axis.set_xlabel(title)
pyplot.tight_layout()
The text was updated successfully, but these errors were encountered:
Could you provide the input image, code, prototxt, and caffemodel to reproduce figure 1 of the paper?
I tried to reproduce figure 1 of the paper based on the pretrained model found in the readme, that is the edge maps of this figure.
However, when I do so, the result is significantly worse as the ones shown in the paper. In fact, they do not seem anything better than some Sobel-like filter. Morover, there is a 35-pixel top-left padding in the output that is awkward and mentioned in several other issues as well.
My code is based on the example notebook . My caffe version is
1.0.0
.The text was updated successfully, but these errors were encountered: