|
30 | 30 | --variations=V Number of images to generate at same time. [default: 1] |
31 | 31 | --seed=SEED Configure the random number generation. |
32 | 32 | --mode=MODE Either "patch" or "gram" to manually specify critics. |
33 | | - --octaves=O Number of octaves to process. [default: 5] |
| 33 | + --octaves=O Number of octaves to process. Defaults to 5 for 512x512, or |
| 34 | + 4 for 256x256 equivalent pixel count. |
34 | 35 | --threshold=T Quality for optimization, lower is better. Defaults to 1e-3 |
35 | 36 | for "patch" and 1e-7 for "gram". |
36 | 37 | --iterations=I Maximum number of iterations each octave. [default: 99] |
|
51 | 52 |
|
52 | 53 | import os |
53 | 54 | import glob |
54 | | -import math |
55 | 55 | import itertools |
56 | 56 |
|
57 | 57 | import docopt |
@@ -83,7 +83,7 @@ def split_string(text: str): |
83 | 83 | "variations": Use(int), |
84 | 84 | "seed": Or(None, Use(int)), |
85 | 85 | "mode": Or(None, "patch", "gram", "hist"), |
86 | | - "octaves": Use(int), |
| 86 | + "octaves": Or(None, Use(int)), |
87 | 87 | "threshold": Or(None, Use(float)), |
88 | 88 | "iterations": Use(int), |
89 | 89 | "device": Or(None, "cpu", "cuda"), |
@@ -134,7 +134,7 @@ def main(): |
134 | 134 | if command == "enhance": |
135 | 135 | zoom = config["zoom"] |
136 | 136 | cmd = commands.Enhance(target_img, source_img, mode=mode, zoom=zoom) |
137 | | - config["octaves"] = int(math.log(zoom, 2) + 1.0) |
| 137 | + config["octaves"] = cmd.octaves |
138 | 138 | config["size"] = (target_img.size[0] * zoom, target_img.size[1] * zoom) |
139 | 139 | if command == "remake": |
140 | 140 | cmd = commands.Remake( |
|
0 commit comments