From f3d6bbc26d3e3b79f3ad302a5ca531751c3e8403 Mon Sep 17 00:00:00 2001 From: Diego Porres Date: Tue, 23 Nov 2021 15:58:52 +0100 Subject: [PATCH] Add PR #45 by Bob Burrough, fix name of pretrained model, add options in discriminator_synthesis.py --- discriminator_synthesis.py | 4 ++-- torch_utils/ops/filtered_lrelu.py | 3 +++ train.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/discriminator_synthesis.py b/discriminator_synthesis.py index 3fc9a4ad..b4840712 100644 --- a/discriminator_synthesis.py +++ b/discriminator_synthesis.py @@ -389,7 +389,7 @@ def discriminator_dream( @click.option('--network', 'network_pkl', help='Network pickle filename', required=True) # Synthesis options @click.option('--seed', type=int, help='Random seed to use', default=0, show_default=True) -@click.option('--random-image-noise', 'image_noise', type=click.Choice(['random', 'perlin']), default='random', show_default=True) +@click.option('--random-image-noise', '-noise', 'image_noise', type=click.Choice(['random', 'perlin']), default='random', show_default=True) @click.option('--starting-image', type=str, help='Path to image to start from', default=None) @click.option('--class', 'class_idx', type=int, help='Class label (unconditional if not specified)', default=None) @click.option('--lr', 'learning_rate', type=float, help='Learning rate', default=5e-3, show_default=True) @@ -403,7 +403,7 @@ def discriminator_dream( @click.option('--octave-scale', type=float, help='Image scale between octaves', default=1.4, show_default=True) @click.option('--unzoom-octave', type=bool, help='Set to True for the octaves to be unzoomed (this will be slower)', default=False, show_default=True) # Individual frame manipulation options -@click.option('--pixel-zoom', type=int, help='How many pixels to zoom per step (positive for zoom in, negative for zoom out, padded with black)', default=2, show_default=True) +@click.option('--pixel-zoom', '-zoom', type=int, help='How many pixels to zoom per step (positive for zoom in, negative for zoom out, padded with black)', default=2, show_default=True) @click.option('--rotation-deg', '-rot', type=float, help='Rotate image counter-clockwise per frame (padded with black)', default=0.0, show_default=True) @click.option('--translate-x', '-tx', type=float, help='Translate the image in the horizontal axis per frame (from left to right, padded with black)', default=0.0, show_default=True) @click.option('--translate-y', '-ty', type=float, help='Translate the image in the vertical axis per frame (from top to bottom, padded with black)', default=0.0, show_default=True) diff --git a/torch_utils/ops/filtered_lrelu.py b/torch_utils/ops/filtered_lrelu.py index 6106c917..18ae3086 100644 --- a/torch_utils/ops/filtered_lrelu.py +++ b/torch_utils/ops/filtered_lrelu.py @@ -29,6 +29,9 @@ def _init(): headers=['filtered_lrelu.h', 'filtered_lrelu.cu'], source_dir=os.path.dirname(__file__), extra_cuda_cflags=['--use_fast_math'], + # Bob Burrough's PR (#45) so that the plugins work in Windows: https://github.com/NVlabs/stylegan3/pull/45 + # No issues found in Ubuntu 20.04, so I add it here as well. + extra_cflags=['/std:c++17'], ) return True diff --git a/train.py b/train.py index 8bd52aba..a3c9b062 100644 --- a/train.py +++ b/train.py @@ -318,7 +318,7 @@ def main(**kwargs): 'afhq512': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-afhqv2-512x512.pkl', 'ffhq1024': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-ffhq-1024x1024.pkl', 'ffhqu1024': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-ffhqu-1024x1024.pkl', - 'ffhq256': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-ffhqu-256x256.pkl', + 'ffhqu256': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-ffhqu-256x256.pkl', 'metfaces': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-metfaces-1024x1024.pkl', 'metfacesu': 'https://api.ngc.nvidia.com/v2/models/nvidia/research/stylegan3/versions/1/files/stylegan3-r-metfacesu-1024x1024.pkl', },