Skip to content

yeedrag/OSDA-ST

Repository files navigation

Official PyTorch implementation for OSDA-ST

How to run

Setup Enviorment

We used python 3.8.5.

python -m venv ~/venv/bus
source ~/venv/bus/bin/activate
pip install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
pip install mmcv-full==1.3.7  # requires the other packages to be installed first

Download the MiT-B5 ImageNet weights provided by SegFormer from their OneDrive and put them in the folder pretrained/.

Setup Datasets

Download the potsdam and vaihingen datasets from ISPRS: Download ISPRS

The final folder structure should look like this:

OSDA-ST
├── ...
├── data
│   ├── potsdam
│   │   ├── img_dir
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── ann_dir
│   │   │   ├── train
│   │   │   ├── val
│   ├── vaihingen
│   │   ├── img_dir
│   │   │   ├── train
│   │   │   ├── val
│   │   ├── ann_dir
│   │   │   ├── train
│   │   │   ├── val

Data Preprocessing: Finally, please run the following scripts to convert the label IDs to the train IDs and to generate the class index for OSDA-SS scenario:

python tools/convert_datasets/potsdam_full_os.py data/potsdam --nproc 8
python tools/convert_datasets/vaihingen_fill_os.py data/vaihingen --nproc 8

Training

python run_experiments.py --config configs/daformer/pot2vai_OS_building.py

Testing

sh test.sh work_dirs/run_name/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published