Home

Awesome

Category-anchor Guided Unsupervised Domain Adaptation for Semantic Segmentation

Qiming Zhang*, Jing Zhang*, Wei Liu, Dacheng Tao

paper

Table of Contents

Introduction

This respository contains the CAG-UDA method as described in the NeurIPS 2019 paper "Category-anchor Guided Unsupervised Domain Adaptation for Semantic Segmentation".

Requirements

The code is implemented based on Pytorch 0.4.1 with CUDA 9.0, Python 3.6.7. The code is trained using a NVIDIA Tesla V100 with 16 GB memory. Please see the 'requirements.txt' file for other requirements.

Usage

Assuming you are in the CAG-UDA master folder.

  1. Preparation:
  1. Setup the config file with directory 'config/adaptation_from_city_to_gta.yml'.
  1. Training
python train.py
  1. Evaluation
python test.py

to see the results.

  1. Constructing anchors
python cac.py
<!-- to train the neural network from GTA5 to Cityscapes: config file: config/adaptation_from_city_to_gta.yml 1. set the dataset path in the config file (data:source:rootpath, 'dataset/GTA5' for example) 2. set the model path to 'training:resume' and 'training:Pred_resume' in the config file (pretrained/from_gta5_to_cityscapes_on_deeplab101_best_model_warmup.pkl for example as training from warmup) 3. run 'train.py' to evaluate the model on Cityscapes validation set: config file: config/test_from_city_to_gta.yml 1. set the dataset path in the config file (data:source:rootpath) 2. set the model path in the config file (test:path) 2. run 'test.py' -->

License

MIT

The code is heavily borrowed from the repository (https://github.com/meetshah1995/pytorch-semseg).

If you use this code and find it usefule, please cite:

@inproceedings{zhang2019category,
  title={Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation},
  author={Zhang, Qiming and Zhang, Jing and Liu, Wei and Tao, Dacheng},
  booktitle={Advances in Neural Information Processing Systems},
  pages={433--443},
  year={2019}
}

Notes

The category anchors are stored in the file 'category_anchors'. It is calculated as the mean value of features with respect to each category from the source domain.

Contact: qzha2506@uni.sydney.edu.au / qmzhangzz@gmail.com