Official implementation of HSF-Net.
git clone
cd HSF-Net
conda env create -f requirements.yml
conda activate HSF-NetPlease download the SegFormer MiT-B4 pretrained backbone and place it under:
pretrained/
└── mit_b4.pth
└── open_clip_pytorch_model.bin
Download links:
| Backbone | Link |
|---|---|
| MiT-B4 | Google Drive |
| CLIP ViT-B-32 | Google Drive |
Then set the path in config.yaml and moedls/prompt_semantic.py:
model:
pretrained_backbone: "/path/to/pretrained/mit_b4.pth"clip_model, _, _ = open_clip.create_model_and_transforms(
model_name=model_name,
pretrained="/path/to/pretrained/open_clip_pytorch_model.bin",
)Experiments are conducted on three RGB-DSM semantic segmentation datasets:
| Dataset | Type | Download |
|---|---|---|
| ISPRS Vaihingen | Public benchmark | Download Dataset |
| ISPRS Potsdam | Public benchmark | Download Dataset |
| Ordos-OPM | Open-pit mining RGB-DSM dataset | Coming Soon |
Please organize the datasets as follows:
datasets/
├── Vaihingen/
├── Potsdam/
└── Ordos/
Then modify the dataset root path in configs/config.yaml:
folder: "/path/to/datasets"bash train_Vaihingen.sh 0or:
CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Vaihingenbash train_Potsdam.sh 0or:
CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Potsdambash train_Ordos.sh 0or:
CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Ordos| Dataset | Backbone | Checkpoint |
|---|---|---|
| ISPRS Vaihingen | MiT-B4 | Coming Soon |
| ISPRS Potsdam | MiT-B4 | Coming Soon |
| Ordos-OPM | MiT-B4 | Coming Soon |