2799b271367c6d73b8f2fc5effef67d011e1991c,GANs/stylegan2/generate.py,,main,#,98

Before Change


        print(f"using style noise seed {args.seed_mix} for layers {args.mix_after}-{num_layers}.")
        rnd = np.random.RandomState(args.seed_mix)
        z2 = rnd.randn(batch_size, 512)
        style_noises = [nn.Variable((batch_size, 512)).apply(d=z)
                        for _ in range(args.mix_after)]
        style_noises += [nn.Variable((batch_size, 512)).apply(d=z2)
                         for _ in range(num_layers - args.mix_after)]
    else:
        // no style mixing (single noise / style is used)
        print(f"using style noise seed {args.seed} for entire layers.")
        style_noise = nn.Variable((batch_size, 512)).apply(d=z)
        style_noises = [style_noise for _ in range(num_layers)]

    nn.load_parameters("styleGAN2_G_params.h5")
    rgb_output = generate(batch_size, style_noises,
                          args.stochastic_seed, args.truncation_psi)
    rgb_output.forward()

    // convert to uint8 to save an image file
    image = convert_images_to_uint8(rgb_output, drange=[-1, 1])
    if args.output_filename is None:

After Change


    parser.add_argument("--truncation-psi", default=0.5, type=float,
                        help="value for truncation trick.")
    
    parser.add_argument("--batch-size", type=int, default=1,
                        help="Number of images to generate.")

    parser.add_argument("--mixing", action="store_true",
                        help="if specified, apply style mixing with additional seed.")
    parser.add_argument("--seed-mix", type=int, default=None,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 20

Instances


Project Name: sony/nnabla-examples
Commit Name: 2799b271367c6d73b8f2fc5effef67d011e1991c
Time: 2020-10-27
Author: Krishna.Wadhwani@sony.com
File Name: GANs/stylegan2/generate.py
Class Name:
Method Name: main


Project Name: sony/nnabla-examples
Commit Name: 2799b271367c6d73b8f2fc5effef67d011e1991c
Time: 2020-10-27
Author: Krishna.Wadhwani@sony.com
File Name: GANs/stylegan2/generate.py
Class Name:
Method Name: main


Project Name: sony/nnabla-examples
Commit Name: 7d8f3f66495979f1bbd27205d422d673991709f2
Time: 2021-01-26
Author: Krishna.Wadhwani@sony.com
File Name: GANs/stylegan2/generate.py
Class Name:
Method Name: main


Project Name: sony/nnabla-examples
Commit Name: 9dab8ae56ce90f1b9ba6808a6e0673ab6f13103e
Time: 2020-12-15
Author: Krishna.Wadhwani@sony.com
File Name: GANs/stylegan2/generate.py
Class Name:
Method Name: main