Comments (1)
The test script is as follows
`import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import matplotlib.cm as cm
import scipy.misc
from PIL import Image
import scipy.io
import os
import caffe
import sys
caffe_root = '../../' # this file is expected to be in {caffe_root}/examples/hed/
sys.path.insert(0, caffe_root + 'python')
im_lst = []
im = Image.open('../img/0001.png')
im = im.resize((200, 200), Image.ANTIALIAS)
in_ = np.array(im, dtype=np.float32)
in_ = in_[:,:,::-1]
in_ -= np.array((104.00698793,116.66876762,122.67891434))
im_lst.append(in_)
idx = 0
gpu = 3
in_ = im_lst[idx]
in_ = in_.transpose((2,0,1))
caffe.set_mode_gpu()
caffe.set_device(0)
model_root = './'
net = caffe.Net(model_root+'deploy.prototxt', model_root+'hed_pretrained_bsds.caffemodel', caffe.TEST)
net.blobs['data'].reshape(1, 3,200,200)
net.reshape()
net.blobs['data'].data[...] = in_
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,:,:]
plt.imsave('./test.png', out1)`
from hed.
Related Issues (20)
- ImportError: dynamic module does not define module export function (PyInit__caffe) HOT 1
- Batch Processing with HED without MATLAB
- Trouble with PostprocessHED.m parameters
- tenosrflow version
- link error undefined symbols for x86_64
- how to test it with RGBD data?
- Is this a memory leak? (python)
- How to get all the (X, Y) values of the edge for one object?
- train error
- Looking for BSDS500 test images computed by pretrained hed model
- NYUDv2 pretrainModel
- Can the parameters of the function edgeNmsMex be modified?
- 为什么,预测出来的边框比较宽? HOT 6
- requirement.txt file HOT 1
- Other datasets
- The preprocess of the dataset? HOT 1
- The augmented BSDS data (1.2GB), HOT 3
- where is Yfuse implemented in code?
- questions about BN layer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hed.