diff options
| author | junyanz <junyanz@berkeley.edu> | 2017-06-12 23:52:56 -0700 |
|---|---|---|
| committer | junyanz <junyanz@berkeley.edu> | 2017-06-12 23:52:56 -0700 |
| commit | e6858e35f0a08c6139c133122d222d0d85e8005d (patch) | |
| tree | 2647ff13a164c684113eab455123394a49a65dad /options | |
| parent | 3b72a659c38141e502b74bee65ca08d51dc3eabf (diff) | |
update dataset mode
Diffstat (limited to 'options')
| -rw-r--r-- | options/base_options.py | 10 | ||||
| -rw-r--r-- | options/test_options.py | 1 | ||||
| -rw-r--r-- | options/train_options.py | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/options/base_options.py b/options/base_options.py index 619ca60..44100cf 100644 --- a/options/base_options.py +++ b/options/base_options.py @@ -2,6 +2,7 @@ import argparse import os from util import util + class BaseOptions(): def __init__(self): self.parser = argparse.ArgumentParser() @@ -21,10 +22,9 @@ class BaseOptions(): self.parser.add_argument('--n_layers_D', type=int, default=3, help='only used if which_model_netD==n_layers') self.parser.add_argument('--gpu_ids', type=str, default='0', help='gpu ids: e.g. 0 0,1,2, 0,2') self.parser.add_argument('--name', type=str, default='experiment_name', help='name of the experiment. It decides where to store samples and models') - self.parser.add_argument('--align_data', action='store_true', - help='if True, the datasets are loaded from "test" and "train" directories and the data pairs are aligned') + self.parser.add_argument('--dataset_mode', type=str, default='unaligned', help='chooses how datasets are loaded. [unaligned | aligned | single]') self.parser.add_argument('--model', type=str, default='cycle_gan', - help='chooses which model to use. cycle_gan, one_direction_test, pix2pix, ...') + help='chooses which model to use. cycle_gan, pix2pix, test') self.parser.add_argument('--which_direction', type=str, default='AtoB', help='AtoB or BtoA') self.parser.add_argument('--nThreads', default=2, type=int, help='# threads for loading data') self.parser.add_argument('--checkpoints_dir', type=str, default='./checkpoints', help='models are saved here') @@ -35,6 +35,8 @@ class BaseOptions(): self.parser.add_argument('--identity', type=float, default=0.0, help='use identity mapping. Setting identity other than 1 has an effect of scaling the weight of the identity mapping loss. For example, if the weight of the identity loss should be 10 times smaller than the weight of the reconstruction loss, please set optidentity = 0.1') self.parser.add_argument('--use_dropout', action='store_true', help='use dropout for the generator') self.parser.add_argument('--max_dataset_size', type=int, default=float("inf"), help='Maximum number of samples allowed per dataset. If the dataset directory contains more than max_dataset_size, only a subset is loaded.') + self.parser.add_argument('--resize_or_crop', type=str, default='resize_and_crop', help='scaling and cropping of images at load time [resize_and_crop|crop|scale_width]') + self.parser.add_argument('--no_flip', action='store_true', help='if specified, do not flip the images for data argumentation') self.initialized = True @@ -59,7 +61,7 @@ class BaseOptions(): print('-------------- End ----------------') # save to the disk - expr_dir = os.path.join(self.opt.checkpoints_dir, self.opt.name) + expr_dir = os.path.join(self.opt.checkpoints_dir, self.opt.name) util.mkdirs(expr_dir) file_name = os.path.join(expr_dir, 'opt.txt') with open(file_name, 'wt') as opt_file: diff --git a/options/test_options.py b/options/test_options.py index c4ecff6..6b79860 100644 --- a/options/test_options.py +++ b/options/test_options.py @@ -1,5 +1,6 @@ from .base_options import BaseOptions + class TestOptions(BaseOptions): def initialize(self): BaseOptions.initialize(self) diff --git a/options/train_options.py b/options/train_options.py index a1d347f..345f619 100644 --- a/options/train_options.py +++ b/options/train_options.py @@ -1,5 +1,6 @@ from .base_options import BaseOptions + class TrainOptions(BaseOptions): def initialize(self): BaseOptions.initialize(self) @@ -19,7 +20,4 @@ class TrainOptions(BaseOptions): self.parser.add_argument('--lambda_B', type=float, default=10.0, help='weight for cycle loss (B -> A -> B)') self.parser.add_argument('--pool_size', type=int, default=50, help='the size of image buffer that stores previously generated images') self.parser.add_argument('--no_html', action='store_true', help='do not save intermediate training results to [opt.checkpoints_dir]/[opt.name]/web/') - self.parser.add_argument('--no_flip' , action='store_true', help='if specified, do not flip the images for data argumentation') - - # NOT-IMPLEMENTED self.parser.add_argument('--preprocessing', type=str, default='resize_and_crop', help='resizing/cropping strategy') self.isTrain = True |
