diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-12 18:02:32 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-12 18:02:32 +0200 |
| commit | 0ad66a09aaf55023d8eaff70094b0798b01adb19 (patch) | |
| tree | 91b5c67271c6898f823cde7b52d46addcd7b3cca /options | |
| parent | 5edd1efbc7b3c02d16b23401cc47a88f50fdf4d5 (diff) | |
mogrify script, flow scripts, dataset options
Diffstat (limited to 'options')
| -rw-r--r-- | options/base_options.py | 1 | ||||
| -rw-r--r-- | options/dataset_options.py | 164 |
2 files changed, 165 insertions, 0 deletions
diff --git a/options/base_options.py b/options/base_options.py index 5bdd85e..150174b 100644 --- a/options/base_options.py +++ b/options/base_options.py @@ -49,6 +49,7 @@ class BaseOptions(): self.initialize() self.opt = self.parser.parse_args() self.opt.isTrain = self.isTrain # train or test + return self.opt str_ids = self.opt.gpu_ids.split(',') self.opt.gpu_ids = [] diff --git a/options/dataset_options.py b/options/dataset_options.py new file mode 100644 index 0000000..2547d11 --- /dev/null +++ b/options/dataset_options.py @@ -0,0 +1,164 @@ +from .base_options import BaseOptions + +class DatasetOptions(BaseOptions): + def initialize(self): + # BaseOptions.initialize(self) + # type = int, float, str OR action='store_true' + + # self.parser.add_argument( + # '--', + # type=int, + # default=0, + # help='' + # ) + + self.parser.add_argument( + '--in_dir', + type=str, + required=True, + help='input directory' + ) + + self.parser.add_argument( + '--out_dir', + type=str, + required=True, + help='output directory' + ) + + self.parser.add_argument( + '--split', + action='store_true', + help='construct train/test/split for this output, as A' + ) + + self.parser.add_argument( + '--ab', + action='store_true', + help='construct test split into directory A and B, where B = in_dir' + ) + + self.parser.add_argument( + '--mov', + action='store_true', + help='generate video from output directory' + ) + + self.parser.add_argument( + '--scp', + action='store_true', + help='scp this file somewhere' + ) + + self.parser.add_argument( + '--scp-to', + type=str, + default="jules@asdf.us:asdf/neural/", + help='scp destination' + ) + + ## IMAGE FILTERS + + ### GRAYSCALE + + self.parser.add_argument( + '--grayscale', + action='store_true', + help='convert image to grayscale first' + ) + + ### CLAHE + + self.parser.add_argument( + '--clahe', + action='store_true', + help='apply clahe contrast correction' + ) + + self.parser.add_argument( + '--clip-limit', + default=2.0, + type=float, + help='clip limit for clahe algorithm (1.0 is subtle, 4.0 is aggressive)' + ) + + ### POSTERIZE + + self.parser.add_argument( + '--posterize', + action='store_true', + help='posterize image' + ) + + self.parser.add_argument( + '--spatial-window', + default=16, + type=int, + help='spatial window for quantize' + ) + + self.parser.add_argument( + '--color-window', + default=64, + type=int, + help='color window for quantize' + ) + + ### BRIGHTNESS GRADIENT + + self.parser.add_argument( + '--brightness-gradient', + action='store_true', + help='gradiate from first frame to last (done in Lab colorspace)' + ) + + self.parser.add_argument( + '--brightness-sigma', + default=64, + type=int, + help='width of brightness gradient along L axis' + ) + + ### BLUR + + self.parser.add_argument( + '--blur', + default=0, + type=int, + help='blur image by N' + ) + + self.parser.add_argument( + '--blur-sigma', + default=0.0, + type=float, + help='blur sigma' + ) + + ### CANNY EDGE DETECTION + + self.parser.add_argument( + '--canny', + action='store_true', + help='do canny edge detection on image' + ) + + self.parser.add_argument( + '--canny_lo', + default=100, + type=int, + help='canny low threshold' + ) + + self.parser.add_argument( + '--canny_high', + default=200, + type=int, + help='canny high threshold' + ) + + def parse(self): + if not self.initialized: + self.initialize() + self.opt = self.parser.parse_args() + return self.opt
\ No newline at end of file |
