Variations-of-SFANet-for-Crowd-Counting
Variations-of-SFANet-for-Crowd-Counting copied to clipboard
How to make GT ground truth map suitable for UCF trained model?
Hello!
I have a ground truth for images in the form of coordinate points. Is there a way to turn this into a ground truth density map that I can use to compare to the MSFA UCF predicted density map and also visualise? So that I can perhaps make a confusion matrix.
Also, for the bayesian processed SH datasets, the .npy files, I get that the first 2 columns are the width and height coordinates, but what does the 3rd column represent? Some sort of distance or radius? Is this something that can be used to create the ground truth map, or is this for something else?
Thank you for your constant updates and help!
Thank you for the questions.
- For typical density map creation based on a Gaussian kernel, please take a look at this density_map.py.
- If I am not mistaken, the distance information generated by bayesian_preprocess_sh.py is for calculating posterior label probability, which derives the Bayesian loss function. More detailed explanation was originally given in this paper.
Hope this helps!
Hello! I have a related question.
I saw that in density_map.py, the Gaussian kernel is given a sigma of 5. Do you know what would be the rationale for that? In the paper you shared they mentioned that a fixed value isn't as good.
Thank you for the questions.
- According to the convolution with geometry-adaptive kernels mentioned in the MCNN paper, a sigma value for each object could be set proportionally to the average distance to its k nearest neighbors. Then you have different values of sigma for different object coordinates.
- You can relax the idea and get a single sigma for a whole image, which at least gives good train&validation performance/curve.
- Roughly speaking, you may try setting sigma > 5 for sparse crowd patterns. And for more dense crowd patterns, you may try sigma < 5.
I Hope this clarifies your questions