Coder Social home page Coder Social logo

pceda's Introduction

Phase Consistent Ecological Domain Adaptation

A message from the authors

Hey guys! Welcome to this repository of our paper 'Phase Consistent Ecological Domain Adaptation', which is accepted by CVPR 2020. First things first, here's a link to our paper. Make sure to read it and you will like it. Currently we are organizing the code and will make it public available soon. Before we get our code ready, we'll first share our pretrained models that can reproduce the results presented in the paper. Check this out:

Our best result on
GTA5 ==> Cityscapes: DeeplabV2+ResNet101: 50.5; VGG16: 44.6
Synthia ==> Cityscapes: DeeplabV2+ResNet101: 53.6 (13 classes); VGG16: 41.1 (16 classes)

All above pre-trained models are compatible with the AdaptSegNet and BDL repositories. Shout out to these authors!

Edit 1

Hi all! I just uploaded the CPN we used in the paper. Check the UNet_CPN.py for details.

I also uploaded the pre-trained model on GTA5 ==> Cityscapes using DRN-26: DRN-26: 42.6. I have tons of models stored in my laptop so hopefully I uploaded the right model. The model should be compatible with CyCADA.

CPN_cycada is the CPN we used to train this model. The parameters are compatible with UNet_CPN.py. train_cpn_cycada.py is the script we used to train this CPN. You may directly put it in the folder of CyCADA and run. I trained my CPN on a laptop, which only allows very small batch size. If you have a stronger GPU, you may tune the batch size and learning rate accordingly for the best outcome. Anyway, you can always use our pre-trained CPN to save your valuable time. This CPN cleans up irregular blobs in the segmentation map pretty well.

Before:

After:

A demo training script using CPN

See CyCADA_train folder.

Style transfer with phase consistency

Please go to the folder named "PCEDA_Phase" and execute the following command for training the image transformation.

python3 train.py --dataroot='./datasets/data_semseg' --gpu_ids='0' --model='cycle_gan' --display_freq=100 --display_ncols=2 --save_latest_freq=2000 --save_epoch_freq=1 --save_by_iter --niter=5 --niter_decay=15 --batch_size=1 --soft_phase=True --norm='instance' --normGNET='instance' --netG='resnet_9blocks' --display_port=18099 --name='gta2city' --lambda_A=10.0 --lambda_B=10.0 --lambda_identity=5.0 --lambda_P=50000.0 --lr=1e-5 --lrG=5e-5

Note: 1) currently there are only 20 example images in the folders "trainA" and "trainB" from GTA5 and CityScapes respectively. Please put the complete dataset in each folder for a reasonable experiment. 2) please check the function named "get_phase_loss" in the file "models/cycle_gan_model.py" for the implemention of the phase constraint; the phase discrepancy is currently weighted by the scalar field of the magnitude for faster convergence.

Exporting transformed images

First comment out Line 41 in the dataloader "PCEDA_Phase/data/unaligned_dataset.py" to disable cropping and then execute the following command:

python3 export_images.py --dataroot='./datasets/data_semseg' --phase='train' --soft_phase=True --model='cycle_gan' --netG='resnet_9blocks' --norm='instance' --normGNET='instance' --name='gta2city' --load_iter=10000 --num_test=20 --results_dir='./results/gta2city'

pceda's People

Contributors

donglao avatar yanchaoyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.