Git Product home page Git Product logo

deep-crowd-counting_crowdnet's People

Contributors

davideverona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-crowd-counting_crowdnet's Issues

Testing density map creation

Here is my test for density map creation, I draw 10 random points and than create density map, however sum over map is not 10, but 6.95563, for 100 points it's 91.6066 and it depens on point positions, how can we approximate it more precise?

import numpy as np
import scipy
import scipy.spatial
import scipy.ndimage
import cv2
from random import randint

def gaussian_filter_density(mask):
    
    density = np.zeros(mask.shape, dtype=np.float32)
    
    gt_count = np.count_nonzero(mask)
    if gt_count == 0:
        return density

    pts = np.array(zip(np.nonzero(mask)[1], np.nonzero(mask)[0]))
    
    leafsize = 2048
    # build kdtree
    tree = scipy.spatial.KDTree(pts.copy(), leafsize=leafsize)
    # query kdtree
    distances, locations = tree.query(pts, k=2, eps=10.)

    for i, pt in enumerate(pts):
        pt2d = np.zeros(mask.shape, dtype=np.float32)
        pt2d[pt[1],pt[0]] = 1.
        if gt_count > 1:
            sigma = distances[i][1]
        else:
            sigma = np.average(np.array(mask.shape))/2./2. #case: 1 point
            
        density += scipy.ndimage.filters.gaussian_filter(pt2d, sigma, mode='constant')
            
    print "np.sum(density): ", np.sum(density)
    
    return density
    
def test_density():
    h= 100
    w= 120
    mask= np.zeros((h,w))
  
    for i in range(0,10):
        y= randint(0,h-1)
        x= randint(0,w-1)
        mask[y,x]= 1
        
    density= gaussian_filter_density(mask)
    
    cv2.imwrite('mask.png', 255*mask)
    cv2.imwrite('density.png', 255*density)
   
test_density()

The error brought by the gt map resize

HI~
When I calculated the number given by the density map, I found there was a difference between the gt density map before and after downsampling(or resize). So if it is correct to train the model with the downsampled gt density map? Which gt number should be used when evaluating the method? The original number given by the dataset or the number calculated by the downsampled gt density map?

How did you deal with the problem? Thank you.

MAE Error achieved

Hi, I ran the code through and the best iteration was the model saved at 1000 (dcc_crowdnet_train_iter_1000.caffemodel)...
Ground truth Avg: 1642.42 MAE: 812.687
I see David achieved similar error in the pynb on the repo, although a little lower (~700), which is probably due to different test data selected in the 20% test. The paper reported error of ~ 420 over 5 folds. Any idea what the gap may be ? Assuming there is a gap...

Could you please provide the caffemodel that you trained?

Hi @davideverona ,
Could you help me? Please^_^
I realized that the last layer of the output is 28x28, the value of the feature points are less than 1, and even negative numbers. So how do I get the final density map of the image via image mosaic?
It is the best for me if you can provide the code (python or c++). My email address is [email protected].
By the way, The caffemodel that I trained still has some problems, so could you please provide the caffemodel for me? Thanks! And the caffemodel that you trained could be applied to low density populations?
I'm looking forward to your reply. Thank you very much!

Samylee

License

Hi Davide Verona,

What is the license of this source code?

A bug in predict function

        for out in net.blobs[out_layer].data:
            y = out[0] #single channel
            Y_deploy.append(y)

the Y_deploy need to be allocated in new memory, or it will be always the last predict result .

            Y_deploy.append(y.copy()) is right.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.