Code Monkey home page Code Monkey logo

Comments (3)

Viresh-R avatar Viresh-R commented on September 13, 2024 2

Hi,
The Gaussian kernel is normalized by its sum, so for any standard deviation, the kernel sums to one. Thus the standard deviation does not affect the count of the density map. It does affect how sharp/diffused the density map is, i.e. a small standard deviation will result in a sharp density map. And for our dataset, we found keeping the SD as quarter window size works well. One motivation for using quarter window size as the SD is the fact that Gaussian distributions contain around 95% of the data within 2 * SD from the mean.

from learningtocounteverything.

m-zheng avatar m-zheng commented on September 13, 2024

Thank you very much for the information.

from learningtocounteverything.

wjun0830 avatar wjun0830 commented on September 13, 2024

Hello. Viresh.
Thanks for the great work.

I have one question related to this issue.

In issue #27 , you mentioned that we can use (https://github.com/CommissarMa/MCNN-pytorch/blob/master/data_preparation/k_nearest_gaussian_kernel.py) to generate gaussian density maps.

However, in the mentioned source, using the quarter window size is not set as default.
Can you explain how you modified the source to generate gaussian density maps for the FSC-147 dataset?
How can I change the following source code to reflect the window size?

    tree = scipy.spatial.KDTree(points.copy(), leafsize=leafsize)
    # query kdtree
    distances, locations = tree.query(points, k=4)

    print ('generate density...')
    for i, pt in enumerate(points):
        pt2d = np.zeros(img_shape, dtype=np.float32)
        if int(pt[1])<img_shape[0] and int(pt[0])<img_shape[1]:
            pt2d[int(pt[1]),int(pt[0])] = 1.
        else:
            continue
        if gt_count > 1:
            sigma = (distances[i][1]+distances[i][2]+distances[i][3])*0.1

Thank you very much.
Best regards.

from learningtocounteverything.

Related Issues (20)

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.