Clothing design program improving StarGAN and Mask R-CNN
(U-net model, 140000 iterations training)
You can download the clothing dataset here!
The folder should be located like StarGAN/data
.
The folder structure should be like this.
All of the test images can be located in just one folder. (don't need to split the images.)
But the other folders should exist even if they are empty.
Dataset Attributes : check, dot, leopard, stripe, tiedye, blue, green, purple, red
Run it from StarGAN
path.
# Train
!python main.py --mode train --dataset RaFD --rafd_crop_size 256 --image_size 256 --c_dim 9 \
--num_iters 140000 \
--rafd_image_dir data/custom/train --sample_dir stargan_custom/samples --log_dir stargan_custom/logs \
--model_save_dir stargan_custom/models --result_dir stargan_custom/results \
--model_save_step 20000 \
--model_name 'U-net'
# Test
!python main.py --mode test --dataset RaFD --image_size 256 --batch_size 1 --c_dim 9 \
--rafd_image_dir data/custom/test \
--sample_dir stargan_custom/samples --log_dir stargan_custom/logs \
--model_save_dir stargan_custom/models --result_dir stargan_custom/results \
--test_iters 140000
The result images are saved in StarGAN/stargan_custom/results
.
(c_dim: number of attributes
num_iters: number of training iterations
model_name: 'U-net' (default) / 'Original' / 'Reconstruction')
You can download pre-trained models here.
140000-G.ckpt
, 140000-D.ckpt
: U-net model (good-performance) <- Use this !
140000-G_origin.ckpt
, 140000-D_origin.ckpt
: Original StarGAN model
140000-G_reconstruction.ckpt
, 140000-D_reconstruction.ckpt
: Reconstruction loss changed model (poor-performance)
The folder should be located like StarGAN/stargan_custom/models
.
Please set the name of model file that you want to use as '140000-G.ckpt' and '140000-D.ckpt'.
Run it from StarGAN
path.
# Test
!python main.py --mode test --dataset RaFD --image_size 256 --batch_size 1 --c_dim 9 \
--rafd_image_dir data/custom/test \
--sample_dir stargan_custom/samples --log_dir stargan_custom/logs \
--model_save_dir stargan_custom/models --result_dir stargan_custom/results \
--test_iters 140000
The result images are saved in StarGAN/stargan_custom/results
.
We referenced this paper. Thanks.
@inproceedings{choi2018stargan,
author={Yunjey Choi and Minje Choi and Munyoung Kim and Jung-Woo Ha and Sunghun Kim and Jaegul Choo},
title={StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
year={2018}
}