junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
22.71k stars 6.28k forks source link

Weird results #1376

Open kalciss opened 2 years ago

kalciss commented 2 years ago

Hello. I try to use CycleGAN for image-to-image translation from synthesized face data to more realistic face images using FFHQ dataset, but i get very weird and very unrealistic results. Anyone have any suggestions or maybe see something that i do incorrectly? image image image

---------------- Options --------------- batch_size: 7 [default: 1] beta1: 0.5
checkpoints_dir: /src/data/models/ [default: ./checkpoints] continue_train: False
crop_size: 256
dataroot: /src/data/dataset [default: None] dataset_mode: unaligned
direction: AtoB
display_env: main
display_freq: 400
display_id: 1
display_ncols: 4
display_port: 8097
display_server: http://localhost
display_winsize: 256
epoch: latest
epoch_count: 1
gan_mode: lsgan
gpu_ids: 0
init_gain: 0.02
init_type: normal
input_nc: 3
isTrain: True [default: None] lambda_A: 10.0
lambda_B: 10.0
lambda_identity: 0.5
load_iter: 0 [default: 0] load_size: 256 [default: 286] lr: 0.001 [default: 0.0002] lr_decay_iters: 65 [default: 50] lr_policy: step [default: linear] max_dataset_size: inf
model: cycle_gan
n_epochs: 20 [default: 100] n_epochs_decay: 360 [default: 100] n_layers_D: 3
name: fakefaces2realfaces [default: experiment_name] ndf: 64
netD: basic
netG: resnet_9blocks
ngf: 64
no_dropout: True
no_flip: False
no_html: False
norm: instance
num_threads: 4
output_nc: 3
phase: train
pool_size: 50
preprocess: resize_and_crop
print_freq: 100
save_by_iter: False
save_epoch_freq: 10 [default: 5] save_latest_freq: 10000 [default: 5000] serial_batches: False
suffix:
update_html_freq: 1000
use_wandb: False
verbose: False
----------------- End -------------------

junyanz commented 2 years ago

You probably need to proprocess your data before feeding them to CycleGAN. I recommend that you (1) apply portrait segmentation (e.g., this one) to remove the background and (2) use face alignment for both source and target domains.