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/
.
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
python run_experiments.py --config configs/daformer/pot2vai_OS_building.py
sh test.sh work_dirs/run_name/