taohan10200 / IIM

PyTorch implementations of the paper: "Learning Independent Instance Maps for Crowd Localization"
MIT License
163 stars 39 forks source link

Can you share the codes for generating GT IIMs? #2

Open BJTUJia opened 3 years ago

BJTUJia commented 3 years ago

Hi there, thanks for this impressive work! I am interested in trying it out on my own counting dataset which uses a point level annotation. Can you share the script for getting the IIM maps from points or dot maps? Thanks very much!

Congratulations on this amazing work!

taohan10200 commented 3 years ago

Before generating IIM from dot labels, we used the NWPU dataset to train a head scale prediction model, which estimates the box size for other crowd datasets. The pre-trained model and the script file will be shared after collation.

If you are in a hurry, we recommend that you can take the dilation approach, generating IIM by setting the maximum size or detecting whether the nearest areas are overlapped as the stop condition. This strategy can also generate IIM for point annotations.

Thanks for your attention!

BJTUJia commented 3 years ago

Thanks! This is very helpful! I will try it out.

gjy3035 commented 3 years ago

You may process the following operation:

  1. set a max width or height for each point, such as 50,100.
  2. run the provided pre-processed code to tackle the overlapping.

This operation is not scale-aware, but it is also a type of IIM. It may cause some performance reductions compared with the paper's scheme.

Besides, as @taohan10200 mentioned, we will provide our size regression model ASAP.

BJTUJia commented 3 years ago

Thanks a lot! @gjy3035 This is quite helpful!

BJTUJia commented 3 years ago

You may process the following operation:

  1. set a max width or height for each point, such as 50,100.
  2. run the provided pre-processed code to tackle the overlapping.

This operation is not scale-aware, but it is also a type of IIM. It may cause some performance reductions compared with the paper's scheme.

Besides, as @taohan10200 mentioned, we will provide our size regression model ASAP.

BJTUJia commented 3 years ago

You may process the following operation:

  1. set a max width or height for each point, such as 50,100.
  2. run the provided pre-processed code to tackle the overlapping.

This operation is not scale-aware, but it is also a type of IIM. It may cause some performance reductions compared with the paper's scheme.

Besides, as @taohan10200 mentioned, we will provide our size regression model ASAP.

Hi there, @gjy3035 @taohan10200 thanks a lot for your tips in generating IIMs. However, when I tried it on my own datatset(I set max width==100), the following error occurs. IndexError: index 4 is out of bounds for axis 0 with size 4, which is thrown by this line: dstpoint = centroids[id[start + 1]]. Since I haven't quite understood your codes yet, I can't figure out what is causing this issue. (ps, it works for some images, but throws this error for others, I can't find the pattern in this error). Can you give me some tips? Thanks very much!

ashok-arjun commented 3 years ago

Hi @gjy3035 and @taohan10200 .

Thanks for this wonderful work.

Are the scripts and models used to generate GT IIMs from point annotations released?

Thanks.

taohan10200 commented 3 years ago

Yes, we now have provided the code that can directly generate IIMs with points only. You can find the function generate_masks_with_points() in dataset_prepare/prepare_NWPU.py.