Skip to content

jwang-rs/CBD-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CBD-pytorch

Official PyTorch implementation of the paper "Counting Beyond Domains: Towards Alignment in Unsupervised Domain Adaptation in Remote Sensing Object Counting".

Pre-trained Models

We provide the checkpoints of models for download via Google Drive:

Environment Setup

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.txt

Usage

Testing Pre-trained Models

We 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.py

Visualizations for selected results are included in the images folder. You can modify the script to test on other images.

Testing on Public/Custom Dataset

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.py

For detailed explanations of the network, please refer to our paper.

Acknowledgements

This codebase builds on and acknowledges the following repositories:

We thank the authors of these repositories for their contributions to the community.

Contact

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

About

Official PyTorch implementation of the paper "Counting Beyond Domains: Towards Alignment in Unsupervised Domain Adaptation in Remote Sensing Object Counting".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages