Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ease the visualization of latent directions #120

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

woctezuma
Copy link
Contributor

@woctezuma woctezuma commented Sep 19, 2020

There are two changes:

  • a CLI argument to be more generic, which lets us sample more than 3 points, compared to:

direction = args.degree * eigvec[:, args.index].unsqueeze(0)
img, _ = g(
[latent],
truncation=args.truncation,
truncation_latent=trunc,
input_is_latent=True,
)
img1, _ = g(
[latent + direction],
truncation=args.truncation,
truncation_latent=trunc,
input_is_latent=True,
)
img2, _ = g(
[latent - direction],
truncation=args.truncation,
truncation_latent=trunc,
input_is_latent=True,
)
grid = utils.save_image(
torch.cat([img1, img, img2], 0),

  • a transposition of the grid of results as I think it makes more sense to show one sample per row (instead of per column).

This is what the transposed results look like:
transposed grid of results

NB: I have submitted a bunch of PR. I have merged all of them in one of my branch for my personal use:
https://github.com/woctezuma/stylegan2-pytorch/tree/quality-of-life-merge
In case you want to merge most of them, this would make it easier for you. Just let me know and I would submit a PR.

@woctezuma woctezuma changed the title Expression transfer Ease the visualization of latent directions Sep 19, 2020
@woctezuma woctezuma force-pushed the expression_transfer branch from 6960694 to 5fa9f30 Compare November 6, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant