Giter Site home page Giter Site logo

gcgan's Introduction

GcGAN: Geometry-Consistent Generative Adversarial Networks for One-Sided Unsupervised Domain Mapping

Paper

Huan Fu and Mingming Gong contribute equally to the project and the paper.

Pretrained Models will avaliable soon.

Poster

Introduction

The codes have been modified from CycleGAN-Pix2Pix and DistanceGAN, and have been tested successfully on CentOS release 6.9, Cuda 9.1, Tesla V100, Anaconda python3, Pytorch 0.4.1.

The codes are only for research purposes. You may also need to follow the instructions of CycleGAN-Pix2Pix and DistanceGAN.

Usage

  1. Clone the respository:
git clone https://github.com/hufu6371/GcGAN.git
cd $GcGAN_ROOT
  1. Download the dataset (Cityscapes):
sh ./scripts/download_cyclegan_dataset.sh cityscapes
  1. Traning and Test (parsing2city):
sh ./train_gcgan.sh
sh ./test_gcgan.sh
  1. Evaluation (parsing2city):
Install pycaffe
Download the pre-trained caffe model following the instructions stated in CycleGAN and Pix2Pix
cd evaluation/parsing2city
python evaluate.py

Pretrained Models

all models

synthetic2real dataset

Tips

  1. For city2parsing, we do not apply scale augmentation. (--loadSize 128, --fineSize 128)
  2. For parsing2city, we set the hyperparameter "identity" as 0.3. For others, the hyperparameter "identity" is 0.5.
  3. For horse2zebra, winter2summer, summer2winter, we do not share parameters for G_{XY} and G_{\tilde{X}\tilde{Y}}. (--model gc_gan_cross)
  4. For svhn2mnist, the training scripts are located in the "models/mnist_to_svhn" directory. Please follow the instructions stated in DistanceGAN for training.
  5. The evaluation scripts are located in the "$GcGAN_ROOT/evalutation" directory.
  6. All the models are trained on 4 GPU cards.

Citation

@inproceedings{FuCVPR19-GcGAN,
  TITLE = {{Geometry-Consistent Generative Adversarial Networks for One-Sided Unsupervised Domain Mapping}},
  AUTHOR = {Fu, Huan and Gong, Mingming and Wang, Chaohui and Batmanghelich, Kayhan and Zhang, Kun and Tao, Dacheng},
  BOOKTITLE = {{IEEE Conference on Computer Vision and Pattern Recognition (CVPR)}},
  YEAR = {2019}
}

Contact

Huan Fu: [email protected]

gcgan's People

Contributors

hufu6371 avatar

Stargazers

 avatar Tan avatar  avatar  avatar Sicheng Yang avatar  avatar  avatar  avatar  avatar 达尔文 avatar Aditya Taparia avatar  avatar Vittorio Giammarino avatar  avatar  avatar Jae Won Choi avatar Nicola Altini avatar  avatar Pengfei Zhu avatar Viktor Studenyak avatar Jihun Lorenzo Park avatar  avatar  avatar Matt Shaffer avatar James Watson avatar Yihao Xia avatar  avatar ChenHuangrong avatar  avatar Sebastian Rietsch avatar  avatar Junlin Han avatar  avatar Jiaming Liu avatar Alexander Morgun avatar pfennig avatar Hungsing avatar Hossein Kashiani avatar YBIO avatar Emmanuel Benazera avatar  avatar Vinicius avatar  avatar Shuchen Du avatar shengyuan avatar  avatar MTamam avatar Hanat avatar  avatar Slice avatar Gopal Krishna avatar 爱可可-爱生活 avatar Ying-Cong Chen avatar Brian Chao avatar Qi Mao avatar Toan Tran avatar Byron Hsu avatar wuyang avatar  avatar  avatar shunming avatar  avatar Yue Gao avatar Yawei Luo avatar xc_scut avatar yanwu xu avatar  avatar Zhouping Wang avatar Wang Bomin avatar  avatar Jing Yang avatar  avatar

Watchers

James Cloos avatar  avatar Matt Shaffer avatar paper2code - bot avatar

gcgan's Issues

Pretrained Models

Hi,

I cannot download the pretrained model from the provided google drive link.
I get the following error Sorry, the file you have requested does not exist.
Has the url been moved?

Regards,

Error with multiprocessing?

Hi, thanks for sharing the project. I was interested in playing around with the model and hoping to recreate some of the baseline results.

When running the train_gcgan.sh script I came into a number of errors. I think there might be an error in the data loader/custom data loading process. The error message I'm receiving is the following:

Traceback (most recent call last):
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 105, in spawn_main
 File "train.py", line 23, in <module>
   exitcode = _main(fd)
   for i, data in enumerate(dataset):
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 114, in _main
 File "C:\Users\manod\Desktop\hand dataset\Geometric_consistent_GAN\data\custom_dataset_data_loader.py", line 44, in __iter__
   prepare(preparation_data)
   for i, data in enumerate(self.dataloader):
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 225, in prepare
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\site-packages\torch\utils\data\dataloader.py", line 451, in __iter__
   _fixup_main_from_path(data['init_main_from_path'])
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
   run_name="__mp_main__")
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\runpy.py", line 263, in run_path
   pkg_name=pkg_name, script_name=fname)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\runpy.py", line 96, in _run_module_code
   mod_name, mod_spec, pkg_name, script_name)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\runpy.py", line 85, in _run_code
   exec(code, run_globals)
 File "C:\Users\manod\Desktop\hand dataset\Geometric_consistent_GAN\train.py", line 23, in <module>
   for i, data in enumerate(dataset):
 File "C:\Users\manod\Desktop\hand dataset\Geometric_consistent_GAN\data\custom_dataset_data_loader.py", line 44, in __iter__
   for i, data in enumerate(self.dataloader):
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\site-packages\torch\utils\data\dataloader.py", line 451, in __iter__
   return _DataLoaderIter(self)
   return _DataLoaderIter(self)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\site-packages\torch\utils\data\dataloader.py", line 239, in __init__
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\site-packages\torch\utils\data\dataloader.py", line 239, in __init__
   w.start()
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\process.py", line 105, in start
   w.start()
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\process.py", line 105, in start
   self._popen = self._Popen(self)
   self._popen = self._Popen(self)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\context.py", line 223, in _Popen
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\context.py", line 223, in _Popen
   return _default_context.get_context().Process._Popen(process_obj)
   return _default_context.get_context().Process._Popen(process_obj)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\context.py", line 322, in _Popen
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\context.py", line 322, in _Popen
   return Popen(process_obj)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
   return Popen(process_obj)
   reduction.dump(process_obj, to_child)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\popen_spawn_win32.py", line 33, in __init__
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\reduction.py", line 60, in dump
   prep_data = spawn.get_preparation_data(process_obj._name)
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 143, in get_preparation_data
   ForkingPickler(file, protocol).dump(obj)
   _check_not_importing_main()
BrokenPipeError: [Errno 32] Broken pipe
 File "C:\Users\manod\Anaconda3\envs\GANtest\lib\multiprocessing\spawn.py", line 136, in _check_not_importing_main
   is not going to be frozen to produce an executable.''')```

Pre-trained model release as promised?

Hi @hufu6371 , thank you so much for this fantastic work.

I finally had the chance to see your team's great presentation from CVPR.

But in the README you mention that you will be releasing the pretrained models soon. I could not find them, so I was wondering what the timeline is.

Thanks a lot!

Typos in gc_cycle_gan_model.py

Hi, thanks a lot for sharing your excellent work.
I find there is a typo in gc_cycle_gan_model.py
rec_B = self.netG_AB(fake_A)
loss_cycle_B = self.criterionCycle(rec_B, self.real_B) * self.opt.lambda_AB
rec_gc_B = self.netG_BA(fake_gc_A)
loss_cycle_B += self.criterionCycle(rec_gc_B, self.real_gc_B) * self.opt.lambda_AB
should be
rec_gc_B = self.netG_AB(fake_gc_A)
I do not know whether it will influence the results.

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.