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.
- Python 3.6
- GPU Memory >= 11G (e.g., GTX2080Ti or GTX1080Ti)
- Pytorch
Download [Dark Zurich Dataset] and [Cityscapes] to run the basic code.
-
Download The Dark Zurich Dataset
-
Download The 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.
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',
}
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
Coming soon ...
We also would like to thank great works as follows:
[1]GCMA
[2]MGCDA
[3]MRNet
[5]https://github.com/layumi/Seg-Uncertainty
[6]https://github.com/wasidennis/AdaptSegNet