Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the sample image #1

Open
twmht opened this issue Aug 22, 2018 · 0 comments
Open

About the sample image #1

twmht opened this issue Aug 22, 2018 · 0 comments

Comments

@twmht
Copy link

twmht commented Aug 22, 2018

Hi,

I run the sample image but got very large count.

Here is what I've done

import sys
sys.path.insert(0, '/home/tumh/caffe/python')
import caffe
import cv2

caffe.set_mode_gpu()
caffe.set_device(0)

net = caffe.Net('/home/tumh/CrowdNet/prototxt/CrowdNet_deploy.prototxt', '/home/tumh/CrowdNet/model/CrowdNet_50000.caffemodel', caffe.TEST)

#  im = cv2.imread('/home/tumh/img/000104.jpg')
im = cv2.imread('/home/tumh/CrowdNet/sample/resize_256x256.jpg').astype(np.float32)
im = im.transpose((2,0,1))
im = im[None,:]
net.blobs['data'].reshape(*(im.shape))
out = net.forward(data=im)
dmap = net.blobs['dmap'].data
dmap = dmap.squeeze()
print dmap.shape
print out['sum']

this would give me the count = 58375.734, obvious this is very far away from the truth.

any advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant