- [2024.05.28] 🔥 Release GIDAS dataset.
- [2024.12.02] 🎉 GASN accepted by Computers and Electronics in Agriculture. 🎉
- [2024.12.02] 🔥 Update Apache 2.0 License.
- [2025.01.16] 🔥 Release model, checkpoint and code. Update usage document.
- Dataset
- Release model, checkpoint and demo code.
- Usage document.
- Pytorch 1.13
- RTX 3060
- Windows 10 and Ubuntu 18.04
Images and density maps can be downloaded from here:
Google Drive and Baidu Netdisk
Backbone chexkpoint is in here:
We Use SAM Vit-H.
Use exp/vis_dataset.py to show annotations of GIDAS.
python ./exp/vis_dataset.pyUse exp/preprocess.py process dataset.
Firstly, we generate ground truth density map for GIDAS.
# generate GIDAS density map step 1, transform file type to mat
# it need only to run once
generate_density_mat()
# generate GIDAS density map step 2
# if set different sigma, it must be rerun
generate_density_map()Secondly, we generate image imbedding for GIDAS to speed up calculations (adapt to 3060)
# generate GIDAS image embedding
gidas_preprocess()Use exp/gasn_demo.py to run demo.
Select one of GIDAS to show effect, such as 103.jpg. (The 103.jpg is default.)
Open exp/dataset_gidas.py to set image in class GIDASDataset function __init__.
self.image_list = ["103.jpg"]Then, you can run it.
python ./exp/gasn_demo.pySome configurations is in exp/config.py.
Use exp/gasn_test.py to test gasn.
Set all of GIDAS to test.
Open exp/dataset_gidas.py to set image in class GIDASDataset function __init__.
self.image_list = os.listdir(self.image_dir)Then, you can test it.
python exp/gasn_test.pypython exp/train.py