Official PyTorch implementation of the paper "Counting Beyond Domains: Towards Alignment in Unsupervised Domain Adaptation in Remote Sensing Object Counting".
We provide the checkpoints of models for download via Google Drive:
The following environment setup was used to ensure reproducibility:
- Python 3.12
- CUDA Toolkit 12.4
- PyTorch 2.5.1
- NumPy 2.1.3
- Matplotlib 3.9.2
- Pillow 11.0.0
Ensure these dependencies are installed using the following command:
pip install -r requirements.txtWe provide code to test our models. The provided models PU2CA_parameter.pth and CA2PU_parameter.pth were adapted from PUCPR+ to CARPK and from CARPK to PUCPR+, respectively.
To visualize model performance on sample images, run the following command:
python test_vis_single.pyVisualizations for selected results are included in the images folder. You can modify the script to test on other images.
We also provide a method to test on public/custom datasets. The dataset should be organized in the following structure:
└── datasets
└── dataset_name
└── test
├── den
│ ├── 1.npy
│ ├── 2.npy
│ └── ...
└── img
├── 1.png
├── 2.png
└── ...
Once your dataset is properly structured, you can run the following command to test:
python test.pyFor detailed explanations of the network, please refer to our paper.
This codebase builds on and acknowledges the following repositories:
We thank the authors of these repositories for their contributions to the community.
If you have any questions or issues, please feel free to reach out to us at: jiayi.wang@whu.edu.cn and guanchen.ding@connect.polyu.hk