Skip to content

Repository files navigation

HSF-Net

Official implementation of HSF-Net.

⚙️ Installation & Dependencies

git clone 
cd HSF-Net

conda env create -f requirements.yml
conda activate HSF-Net

🔗 Pretrained Backbone

Please 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",
        )

🛰️ Datasets

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"

🚀 Training

Train on ISPRS Vaihingen

bash train_Vaihingen.sh 0

or:

CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Vaihingen

Train on ISPRS Potsdam

bash train_Potsdam.sh 0

or:

CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Potsdam

Train on Ordos-OPM

bash train_Ordos.sh 0

or:

CUDA_VISIBLE_DEVICES=0 python train.py training_dataset=Ordos

📦 Checkpoints

Dataset Backbone Checkpoint
ISPRS Vaihingen MiT-B4 Coming Soon
ISPRS Potsdam MiT-B4 Coming Soon
Ordos-OPM MiT-B4 Coming Soon

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages