GitHub - lzy7976/union-set-model-adaptation: Union-set Multi-source Model Adaptation for Semantic Segmentation (original) (raw)
Introduction
A PyTorch implementation of our ECCV2022 paper titled "Union-set Multi-source Model Adaptation for Semantic Segmentation".
Requirements
Pytorch version: 1.11.0, CUDA version: 11.1, GPU: one Tesla V100 32GB.
Datasets
- Source domains:
- Target domain:
Download the datasets, name the folders as the dataset names (Cityscapes, Synscapes, GTA5, SYNTHIA), and put them in the same folder.
Training procedure
- Download the initial weights.
- Train source-domain models with the source-domain data.
python train_stage0.py --source two or three of Synscapes, GTA5 and SYNTHIA \
--label_setting f or p or n \
--data_dir path/to/datasets \
--checkpoint_path path/to/save/checkpoints/to
- Produce pseudo labels with the source-domain models.
python pseudo_label.py --source two or three of Synscapes, GTA5 and SYNTHIA \
--label_setting f or p or n \
--data_dir path/to/datasets \
--stage 1 \
--restore_path path/to/checkpoint/path/of/stage0 \
--pseudo_label_path path/to/save/pseudo/labels/to
- Train models of stage 1.
python train_stage1.py --source two or three of Synscapes, GTA5 and SYNTHIA \
--label_setting f or p or n \
--data_dir path/to/datasets \
--checkpoint_path path/to/save/checkpoints/to \
--restore_path path/to/checkpoint/path/of/stage0 \
--pseudo_label_path path/to/pseudo/labels
- Produce pseudo labels with the models of stage 1.
python pseudo_label.py --source two or three of Synscapes, GTA5 and SYNTHIA \
--label_setting f or p or n \
--data_dir path/to/datasets \
--stage 2 \
--restore_path path/to/checkpoint/path/of/stage1 \
--pseudo_label_path path/to/save/pseudo/labels/to
- Train the final models of stage 2.
python train_stage2.py --source two or three of Synscapes, GTA5 and SYNTHIA \
--label_setting f or p or n \
--data_dir path/to/datasets \
--checkpoint_path path/to/save/checkpoints/to \
--restore_path path/to/checkpoint/path/of/stage1 \
--pseudo_label_path path/to/pseudo/labels