/ccd

This is the source code for our paper Classification Constrained Discriminator for Domain Adaptive Semantic Segmentation

Primary LanguagePython

Classification Constrained Discriminator for Domain Adaptive Semantic Segmentation

Introduction

This is the source code for our paper Classification Constrained Discriminator for Domain Adaptive Semantic Segmentation

Network Architecture

The architecture of our proposed model is as follows network

Installation

  • 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

Dataset

  • 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

Testing

cd ccd

python evaluate_cityscapes.py --model VGG --restore-from ./ccd_model/GTA5_vgg_37.58.pth
python compute_iou.py ../Cityscapes/gtFine/val result/cityscapes

python evaluate_cityscapes.py --model ResNet --restore-from ./ccd_model/GTA5_resnet_42.65.pth
python compute_iou.py ../Cityscapes/gtFine/val result/cityscapes

Training

  • 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

Acknowledgements

This code is heavily borrowed from AdaptSegNet

Citation

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}
}