Giter VIP home page Giter VIP logo

sologan's Introduction

Multimodal image-to-image translation via a single generative adversarial network

Our model architecture is defined as depicted bellow, please refer to the paper for more details:

Usage Guidance

Dependencies

  1. python 3.x
  2. pytorch 4.0+

Testing

  • Runing the following command to translate edges to shoes&handbags (the pretrained models are stored in ./checkpoints/edges_shoes&handbags directory):
python ./test.py --name edges_shoes&handbags --d_num 2

Then the translated samples are stored in ./checkpoints/edges_shoes&handbags/edges_shoes&handbags_results directory. By default, it produce 5 random translation outputs.

Training

  • Download the dataset you want to use and move to ./datasets. For example, you can use the horse2zebra dataset provided by CycleGAN. Please make sure that you have the following directory tree structure in your repository
├── datasets
│   └── horse2zebra
│       ├── trainA
│       ├── testA
│       ├── trainB
│       ├── testB

The Animals With Attributes (AWA) dataset can be downloaded from hear.

  • Start training with the following command:
python ./train.py --name horse2zebra --d_num 2

Intermediate image outputs and model binary files are stored in ./checkpoints/horse2zebra/web

Results

Edges ↔ Shoes&handbags:

Horse ↔ Zebra:

Cat ↔ Dog ↔ Tiger:

Leopard ↔ Lion ↔ Tiger:

Photos ↔ Vangogh ↔ Monet ↔ Cezanne:

bibtex

If this work helps to easy your research, please cite this paper :

@article{huang2022multimodal,
  title={Multimodal image-to-image translation via a single generative adversarial network},
  author={Huang, Shihua and He, Cheng and Cheng, Ran},
  journal={IEEE Transactions on Artificial Intelligence},
  year={2022},
  publisher={IEEE}
}

Acknowledgment

The code used in this research is based on SingleGAN and CycleGAN.

sologan's People

Contributors

shihuahuang95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sologan's Issues

FileNotFoundError: [WinError 3] The system cannot find the path specified: '/raid/huangsh/datasets/horse2zebra'

Thnak you so much for your contriutions. I get this error when I try to run training command on windows 11, Python 3. Please help...

------------ Options -------------
Add_CIN_CE: False
Add_CIN_SE: True
D_lr: 0.0002
G_lr: 0.0002
batchSize: 1
c_gan_mode: lsgan
c_num: 8
checkpoints_dir: /checkpoints
continue_train: False
crop_size: 256
d_num: 2
dataroot: /raid/huangsh/datasets
dir_name: SNEG_cls_100
dis_nums: 6
display_freq: 100
display_id: 1
display_port: 8000
display_winsize: 256
e_blocks: 6
format: png
gpu: 10
img_size: 286
init_type: xavier
input_nc: 3
isTrain: True
lambda_c: 1.0
lambda_cyc: 10.0
lambda_rec: 10.0
lambda_vgg: 10.0
nThreads: 4
name: horse2zebra
ndf: 64
nef: 64
ngf: 64
niter: 50
niter_decay: 50
no_html: False
norm: instance
output_nc: 3
print_freq: 200
save_epoch_freq: 20
save_latest_freq: 3000
up_paired: False
up_type: Trp
update_html_freq: 300
which_epoch: latest
-------------- End ----------------
Start preprocessing dataset..!
Traceback (most recent call last):
File "train.py", line 11, in
data_loader = CreateDataLoader(opt)
File "D:\SoloGAN\data\dataloader.py", line 13, in CreateDataLoader
dataset = UpPairedDataset(opt.dataroot, opt.crop_size, opt.img_size, opt.isTrain, sourceD=sourceD, format=opt.format)
File "D:\SoloGAN\data\dataloader.py", line 29, in init
self.preprocess()
File "D:\SoloGAN\data\dataloader.py", line 61, in preprocess
dirs = os.listdir(self.image_path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: '/raid/huangsh/datasets/horse2zebra'

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.