Comments (5)
Hi @zerollzeng ,
First, please note that the implementation for the generator was taken from rosinality.
With that said, in our repo we provide code that you can adopt for generating random samples using our pSp network and StyleGAN generator. Specifically, please refer to our inference.py
script for an implementation for generating a random latent vector that we use for style mixing here:
pixel2style2pixel/scripts/inference.py
Lines 117 to 121 in ac7da53
Although here we only store latent_to_inject
, you can make a few changes that will store the generated corresponding random face image for the random latent vector.
For example, the following code should be a good starting point for your needs:
n_images_to_generate = 10
generated_images = []
for _ in range(n_images_to_generate):
random_vec = np.random.randn(1, 512).astype('float32')
random_image, _ = net(torch.from_numpy(random_vec).to("cuda"), input_code=True, return_latents=True)
generated_images.append(random_image)
Here, we generate random w
vectors which are fed into pSp to randomly generate face images of size 256x256
.
Please let me know if this is clear and if you have further questions.
from pixel2style2pixel.
Oh thanks for your detailed explanation, I understand it now ::smile::
I'm reading your paper and code, doing some experiment, your jobs is fantastic! I think it would be great if we keep this issue open so that we can continue the discussion instead of open a new issue 👍
from pixel2style2pixel.
I'm going to train your encoder network from scratch, here are some question I'm interested:
- What's the difference between GradualStyleEncoder, BackboneEncoderUsingLastLayerIntoW, and BackboneEncoderUsingLastLayerIntoWPlus?
- Does the num_layer's (50, 100, 152) affect the reconstruct result a lot?
from pixel2style2pixel.
Thank you for the kind words!
Regarding your questions:
- These architectures refer to official pSp encoder, the Naive W+ encoder, and W Encoder mentioned in the paper, respectively. The pSp architecture is explained in Section 3 in the paper and is illustrated in Figure 2. For an explanation of the two later architectures, please refer to the results shown in Section 4.1 (StyleGAN Inversion) in the paper where we discuss the ablation study performed.
- In our experiments, we did not change the
num_layers
from the default value of50
. That is, in all experiments, we use a pretrained IR-SE50 model (which we linked in the README).
Please let me know if you have further questions.
from pixel2style2pixel.
Closing due to inactivity.
from pixel2style2pixel.
Related Issues (20)
- do a huggingface demo HOT 1
- How to train on paired data? HOT 1
- latent image editing HOT 1
- About celebs_seg_to_face HOT 1
- multiple GPUs HOT 4
- Using my own pretrained model from vanilla StyleGAN2 HOT 3
- Is it possible video2anime train? like this project? HOT 3
- A problem about how to get diverse images? HOT 1
- the output image become brown HOT 3
- Need help with running the code on CPU HOT 1
- loading pretrained weights, STACK_GLOBAL requires str HOT 1
- How to train pSp on Z+ space? HOT 2
- Is it possible to create output images in profile (side-on) perspective using sketch to face? HOT 1
- Single channel input with Moco loss not working. HOT 2
- Some error reporting problems encountered during operation HOT 1
- How to use other identity loss rather than Arcface or Moco HOT 2
- How to use psp for Face beautification
- loss jump problem HOT 1
- Retraining
- How can I use the style mixing to just change the hair color.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixel2style2pixel.