Skip to content
/ UACDA Public

Uncertainty Aware Curriculum Domain Adaptation. Code for The UIoU Dark Zurich Challenge @ Vision for All Seasons Workshop, CVPR 2020

License

Notifications You must be signed in to change notification settings

qimw/UACDA

Repository files navigation

Uncertainty Aware Curriculum Domain Adaptation

Python 3.6 License: MIT

In this repo, we provide our 1st place code for The UIoU Dark Zurich Challenge @ Vision for All Seasons Workshop, CVPR 2020 and our presentation PPT is here.

We proposed Uncertainty Aware Curriculum Domain Adaptation pipeline to solve the adaptation problem. Different from [1] and [2] we don't use GPS corresponding relations in this solution thus it is more general.

Pipeline

Pipeline

Prerequisites

  • Python 3.6
  • GPU Memory >= 11G (e.g., GTX2080Ti or GTX1080Ti)
  • Pytorch

Prepare Data

Download Dataset

Download [Dark Zurich Dataset] and [Cityscapes] to run the basic code.

Prapare Twilight and nighttime Cityscapes Dataset

For performing gradually adaptation from day to night, we need to generate labeled twilight and nighttime cityscapes datasets using cyclegan. We use this repo in the challenge.

Here are some results: Cyclegan Results

Generate Image Lists

After generating twilight and nighttime cityscapes training images, we need to prepare image lists for the convenience of training and test.

We create a path dict containing all training images lists in ./dataset/all_file_paths.py. Every text file contains corresponding traing images' absolute path except for those marked with autogenerated. They are the indexes of images which will be generated during training.

all_file_paths = {
# cityscapes
'city_day_imgs_txt':'cityscapes_day.txt',
'city_night_imgs_txt':'cityscapes_night.txt',
'city_twilight_imgs_txt':'cityscapes_twilight.txt',
'city_lbls_txt': 'gts.txt',

# dark zurich
'zurich_day_imgs_txt':'zurich_day.txt',
'zurich_day_plbls_txt':'./file_lists/zurich_day_plbls.txt', # autogenerated

'zurich_night_imgs_txt':'zurich_night.txt',
'zurich_night_plbls_txt':'./file_lists/zurich_night_plbls.txt', # autogenerated

'zurich_twilight_imgs_txt':  'zurich_twilight.txt',
'zurich_twilight_plbls_txt': './file_lists/zurich_twilight_plbls.txt', #auto generated

'zurich_test_imgs_txt': 'zurich_night_test.txt',
'zurich_val_imgs_txt': 'zurich_night_val.txt',
}

Training and Test

As there are many training steps in our pipeline, we manage our training procedure in the train_all_states_gradual.py for convenience.

1.From cityscapes day to dark zurich day
  -- Generate aligned model - day_to_day
  -- Generate pseudo label - gen_day_pseudo
  -- Finetune with pseudo - ft_day_pseudo

2.From day to twilight
  -- Generate rectified model - day_to_twilight
  -- Generate pseudo label - gen_twilight_pseudo
  -- Finetune with pseudo - ft_twilight_pseudo

3.From twilight to night
  -- Generate rectified model - twilight_to_night
  -- Generate pseudo label - gen_night_pseudo
  -- Finetune with pseudo - ft_night_pseudo

4.Test on dark zurich night - gen_test_result

Pretrained Model

Coming soon ...

Results

Pipeline

Related Works

We also would like to thank great works as follows:

[1]GCMA

[2]MGCDA

[3]MRNet

[4]MRNet+Rectifying

[5]https://github.com/layumi/Seg-Uncertainty

[6]https://github.com/wasidennis/AdaptSegNet

[7]https://github.com/RoyalVane/CLAN

[8]https://github.com/yzou2/CRST

About

Uncertainty Aware Curriculum Domain Adaptation. Code for The UIoU Dark Zurich Challenge @ Vision for All Seasons Workshop, CVPR 2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages