Skip to content

Commit 4c54835

Browse files
authored
Merge pull request #112 from woctezuma/config-e
Add --channel_multiplier option to apply_factor.py
2 parents 7be6e64 + f4bb969 commit 4c54835

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎apply_factor.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
default=5,
2222
help="scalar factors for moving latent vectors along eigenvector",
2323
)
24+
parser.add_argument(
25+
"--channel_multiplier",
26+
type=int,
27+
default=2,
28+
help='channel multiplier factor. config-f = 2, else = 1',
29+
)
2430
parser.add_argument("--ckpt", type=str, required=True, help="stylegan2 checkpoints")
2531
parser.add_argument(
2632
"--size", type=int, default=256, help="output image size of the generator"
@@ -50,7 +56,7 @@
5056

5157
eigvec = torch.load(args.factor)["eigvec"].to(args.device)
5258
ckpt = torch.load(args.ckpt)
53-
g = Generator(args.size, 512, 8).to(args.device)
59+
g = Generator(args.size, 512, 8, channel_multiplier=args.channel_multiplier).to(args.device)
5460
g.load_state_dict(ckpt["g_ema"], strict=False)
5561

5662
trunc = g.mean_latent(4096)

0 commit comments

Comments
 (0)