This is the source code for our paper Classification Constrained Discriminator for Domain Adaptive Semantic Segmentation
The architecture of our proposed model is as follows
-
Install PyTorch 0.4 with Python 3 and CUDA 8.0
-
Clone this repo
git clone https://github.com/NUST-Machine-Intelligence-Laboratory/ccd.git
-
Download the GTA5 Dataset as the source domain, and put it in the
GTA5
folder -
Download the Cityscapes Dataset as the target domain, and put it in the
Cityscapes
folder
cd ccd
- Download the trained VGG model GTA5-to-Cityscapes VGG model and put it in the
ccd_model
folder
python evaluate_cityscapes.py --model VGG --restore-from ./ccd_model/GTA5_vgg_37.58.pth
python compute_iou.py ../Cityscapes/gtFine/val result/cityscapes
- Or,download the trained ResNet model GTA5-to-Cityscapes ResNet model and put it in the
ccd_model
folder
python evaluate_cityscapes.py --model ResNet --restore-from ./ccd_model/GTA5_resnet_42.65.pth
python compute_iou.py ../Cityscapes/gtFine/val result/cityscapes
- Download the initial pre-trained VGG model Initial VGG model and put it in the
model
folder
python train.py --model VGG --snapshot-dir ./snapshots/GTA2Cityscapes --lambda-adv-target 0.001 --lambda-s 0.5
- Or,download the initial pre-trained ResNet model Initial ResNet model and put it in the
model
folder
python train.py --model ResNet --snapshot-dir ./snapshots/GTA2Cityscapes --lambda-adv-target 0.001 --lambda-s 0.5
- Tip: The best-performance model might not be the final one in the last epoch. If you want to evaluate every saved models in bulk, please use bulk_evaluate.py and bulk_iou.py, the result will be saved in an Excel sheet.
python bulk_evaluate.py
python bulk_iou.py
This code is heavily borrowed from AdaptSegNet
If you find this useful in your research, please consider citing:
@inproceedings{chen2020classification,
title={Classification Constrained Discriminator for Domain Adaptive Semantic Segmentation},
author={Tao Chen, Jian Zhang, Guo-Sen Xie, Yazhou Yao, Xiaoshui Huang, Zhenmin Tang},
booktitle={IEEE International Conference on Multimedia and Expo (ICME)},
year={2020}
}