Skip to content

Commit 6693a59

Browse files
committed
add mini_colorization dataset and remove imagepool from pix2pix
1 parent 8c0e4b5 commit 6693a59

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

datasets/download_cyclegan_dataset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FILE=$1
22

3-
if [[ $FILE != "ae_photos" && $FILE != "apple2orange" && $FILE != "summer2winter_yosemite" && $FILE != "horse2zebra" && $FILE != "monet2photo" && $FILE != "cezanne2photo" && $FILE != "ukiyoe2photo" && $FILE != "vangogh2photo" && $FILE != "maps" && $FILE != "cityscapes" && $FILE != "facades" && $FILE != "iphone2dslr_flower" && $FILE != "ae_photos" && $FILE != "mini" && $FILE != "mini_pix2pix" ]]; then
3+
if [[ $FILE != "ae_photos" && $FILE != "apple2orange" && $FILE != "summer2winter_yosemite" && $FILE != "horse2zebra" && $FILE != "monet2photo" && $FILE != "cezanne2photo" && $FILE != "ukiyoe2photo" && $FILE != "vangogh2photo" && $FILE != "maps" && $FILE != "cityscapes" && $FILE != "facades" && $FILE != "iphone2dslr_flower" && $FILE != "ae_photos" && $FILE != "mini" && $FILE != "mini_pix2pix" && $FILE != "mini_colorization" ]]; then
44
echo "Available datasets are: apple2orange, summer2winter_yosemite, horse2zebra, monet2photo, cezanne2photo, ukiyoe2photo, vangogh2photo, maps, cityscapes, facades, iphone2dslr_flower, ae_photos"
55
exit 1
66
fi

models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
-- self.loss_names (str list): specify the training losses that you want to plot and save.
1313
-- self.model_names (str list): specify the images that you want to display and save.
1414
-- self.visual_names (str list): define networks used in our training.
15-
-- self.optimizers (optimzier list): define and initialize optimizers. You can define one optimizer for each network. If two networks are updated at the same time, you can use itertools.chain to group them. See cycle_gan_model.py for an example.
15+
-- self.optimizers (optimizer list): define and initialize optimizers. You can define one optimizer for each network. If two networks are updated at the same time, you can use itertools.chain to group them. See cycle_gan_model.py for an usage.
1616
1717
Now you can use the model class by specifying flag '--model dummy'.
18-
See our template model class 'template_model.py' for an example.
18+
See our template model class 'template_model.py' for more details.
1919
"""
2020

2121
import importlib

models/pix2pix_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import torch
2-
from util.image_pool import ImagePool
32
from .base_model import BaseModel
43
from . import networks
54

@@ -62,7 +61,6 @@ def __init__(self, opt):
6261
opt.n_layers_D, opt.norm, opt.init_type, opt.init_gain, self.gpu_ids)
6362

6463
if self.isTrain:
65-
self.fake_AB_pool = ImagePool(opt.pool_size)
6664
# define loss functions
6765
self.criterionGAN = networks.GANLoss(opt.gan_mode).to(self.device)
6866
self.criterionL1 = torch.nn.L1Loss()
@@ -92,7 +90,7 @@ def forward(self):
9290
def backward_D(self):
9391
"""Calculate GAN loss for the discriminator"""
9492
# Fake; stop backprop to the generator by detaching fake_B
95-
fake_AB = self.fake_AB_pool.query(torch.cat((self.real_A, self.fake_B), 1)) # we use conditional GANs; we need to feed both input and output to the discriminator
93+
fake_AB = torch.cat((self.real_A, self.fake_B), 1) # we use conditional GANs; we need to feed both input and output to the discriminator
9694
pred_fake = self.netD(fake_AB.detach())
9795
self.loss_D_fake = self.criterionGAN(pred_fake, False)
9896
# Real

0 commit comments

Comments
 (0)