Skip to content

onedayatatime0923/Cycle_Mcd_Gan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Combination of CycleGan and Mcd in Pytorch

This is my PyTorch implementation for semi-supervised un-paired co-training. Although it is not yet been completed, it is nolonger under development.

This package includes CycleGAN, MCD_DA

The code was written by Chia-Ming Chang.

Note: The current software works well with PyTorch 0.4.

Prerequisites

  • Linux
  • NVIDIA GPU + CUDA CuDNN (CPU mode and CUDA without CuDNN may work with minimal modification, but untested)

Getting Started

Installation

git clone https://github.com/onedayatatime0923/Cycle_Mcd_Gan
cd Cycle_Mcd_Gan

Dataset

Cityscapes

Cityscapes
└───image
│   └───train
│   │   └───aachen
│   │   │     aachen_000000_000019_leftImg8bit.png
│   │   │     ...
│   │   ...
│   │
│   └───val
│   │   └───frankfurt
│   │   │     frankfurt_000000_000294_leftImg8bit.png
│   │   │     ...
│   │   ...
│   │
│   └───test
│       └───berlin
│       │     berlin_000000_000019_leftImg8bit.png
│       │     ...
│       ...
│   
└───label
    └───train
    │   └───aachen
    │   │     aachen_000000_000019_gtFine_labelIds.png
    │   │     ...
    │   ...
    │
    └───val
    │   └───frankfurt
    │   │     frankfurt_000000_000294_gtFine_labelIds.png
    │   │     ...
    │   ...
    │
    └───test
        └───berlin
        │     berlin_000000_000019_gtFine_labelIds.png
        │     ...
        ...
  • Generate txt file
python3 datamanager/generate_txt.py [directory of Cityscapes Dataset]

GTA

GTA
└───image
│     00001.png
│     ...
│   
└───label
      00001.png
      ...
  • Split data
python3 datamanager/split_gta.py [directory of GTA Dataset] [path of split.mat]

Note: the datastructure will become like this

Cityscapes
└───image
│   └───train
│   │     00001.png
│   │     ...
│   │
│   └───val
│   │     00022.png
│   │     ...
│   │
│   └───test
│         00011.png
│         ...
│   
└───label
    └───train
    │     00001.png
    │     ...
    │
    └───val
    │     00022.png
    │     ...
    │
    └───test
          00022.png
          ...
  • Generate txt file
python3 datamanager/generate_txt.py [directory of GTA Dataset]

Train

  • Train a model:
python3 cycle_mcd_trainer.py

Display UI

Optionally, for displaying images during training and test, use the tensorboardX

cd checkpoints/cycle_mcd_da
tensorboard --logdir log

Citation

@inproceedings{CycleGAN2017,
  title={Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networkss},
  author={Zhu, Jun-Yan and Park, Taesung and Isola, Phillip and Efros, Alexei A},
  booktitle={Computer Vision (ICCV), 2017 IEEE International Conference on},
  year={2017}
}

@article{saito2017maximum,
  title={Maximum Classifier Discrepancy for Unsupervised Domain Adaptation},
  author={Saito, Kuniaki and Watanabe, Kohei and Ushiku, Yoshitaka and Harada, Tatsuya},
  journal={arXiv preprint arXiv:1712.02560},
  year={2017}
}

Acknowledgments

code is done in iis sinica.

Related Projects:

CycleGAN: Project | Paper

MCD_DA: Project | Paper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages