Comments (11)
Note that the number of style vectors can be computed by
n_styles = int(math.log(output_size, 2)) * 2 - 2
For example, for a 1024x1024 output resolution we have 18 style vectors while for a resolution of 256x256 we have 14 style vectors.
from pixel2style2pixel.
Hi @jis478 ,
Yes this is definitely possible!
Notice that in psp_encoder.py
we have the following line:
You can change this line to have whatever number of latents you need.
Just make sure that if you load the average latent, you repeat the vector the correct number of times. That is, you need to adjust the following line:
pixel2style2pixel/models/psp.py
Line 64 in 89935c4
There may be some other small modifications that you may need to do, but this should help you get started.
from pixel2style2pixel.
I have tested another stylegan2 implementation by Tetratrio. It just take a little modification of the codes (just replace the Generator
class).
from pixel2style2pixel.
The final missing piece here; do you also support the more recent Pytorch implementation of Stylegan2-ADA-pytorch? The authors indicate that it is compatible with pickles from the old repo but I don't know if it works the other way around.
We actually haven't tried it, but I feel like it won't work out-of-the-box because the names of the model parameters will most likely be different than what is used in rosinality's pytorch stylegan implementation (which is what we use here).
However, if you replace the Generator
class used in this repository with the Generator
used in Stylegan2-ADA-pytorch I believe it should work.
from pixel2style2pixel.
Hello, @yuval-alaluf ! What if I want to use another stylegan weights ranther than the specific stylegan2 weights? Because I found the code is only for stylegan2 model. Would I use the official stylegan weights to train the psp?
from pixel2style2pixel.
The StyleGAN model that you use must be compatible with rosinality's StyleGAN implementation. Therefore, you may use models that are trained using either:
- rosinality's pytorch repository
- NVIDIA's official tensorflow respository (https://github.com/NVlabs/stylegan2 or https://github.com/NVlabs/stylegan2-ada) and are then converted to pytorch using rosinality's conversion script.
from pixel2style2pixel.
Thanks for the input @xjw00654 !
Based on this, you may find it possible to use weights from different sources by making the necessary adjustments to the code.
I am closing this issue for now as I believe the question has been answered.
from pixel2style2pixel.
Hi everyone!
I'm also trying to train pSp on my own dataset (not faces).
@jis478 how did you calculate the number of the style count, why for 256 image size the style count is 14?
In general, I'll be happy for any conclusions form your training experience.
Thanks :)
from pixel2style2pixel.
The final missing piece here; do you also support the more recent Pytorch implementation of Stylegan2-ADA-pytorch? The authors indicate that it is compatible with pickles from the old repo but I don't know if it works the other way around.
from pixel2style2pixel.
I tested a stylegan2-ada-pytorch pickle and it doesn't work with rosinality's conversion script unfortunately- it crashes trying to load from torch_utils
(which only exists in the stylegan2-ada-pytorch repo). Oh well :)
I will see if I can get the Generator approach working instead.
from pixel2style2pixel.
I tested a stylegan2-ada-pytorch pickle and it doesn't work with rosinality's conversion script unfortunately- it crashes trying to load from
torch_utils
(which only exists in the stylegan2-ada-pytorch repo). Oh well :)I will see if I can get the Generator approach working instead.
Right. The conversion script will work on the tensorflow code for StyleGAN2 and ADA. But for the new pytorch code more changes will be needed. Looking forward to an update if you get it to work!
from pixel2style2pixel.
Related Issues (20)
- 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.
- Can we use the latent_mask in ffhq_encode aswell ? HOT 1
- x,y = batch
- Auxiliary adversarial loss term
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.