hamzapehlivan / StyleRes

Other
70 stars 3 forks source link

Some question about the code #6

Closed taluos closed 1 month ago

taluos commented 6 months ago

Dear author, I can't find where the code for these two modules is as shown in the image. Can you tell me where i can find them, thank you.

屏幕截图 2024-05-10 154907
hamzapehlivan commented 6 months ago

Hello, they are embedded into StyleGAN generator. This if statement is the starting point of forward pass for them: https://github.com/hamzapehlivan/StyleRes/blob/9c62ab7497206d47346148d4090fcf5e92e7e199/models/stylegan2.py#L583

taluos commented 4 months ago

Hello, I appreciate your feedback and thank you for the training code you sent me via email. After further training, I have some additional questions:

1:After 500,000 iterations of training the model, I achieved an FID score of 11.4 on CelebA, which is good progress, but still quite far from the 7 reported in the paper. My question is: approximately how many iterations are needed to achieve similar results as in the paper?

2:If I want to conduct ablation experiments, such as removing E1 or E2 individually, how should I proceed?

shartoo commented 4 months ago

Can this repo be trained on a single GPU(12GB) ?

taluos commented 4 months ago

Can this repo be trained on a single GPU(12GB) ?

Absolutely, I have used a P4 (8GB) for model training. However, the training speed might be quite slow.

shartoo commented 4 months ago

Can this repo be trained on a single GPU(12GB) ?

Absolutely, I have used a P4 (8GB) for model training. However, the training speed might be quite slow.

How long does it take to train a new model,i need a 512x512 model with some new dataset.

taluos commented 4 months ago

Can this repo be trained on a single GPU(12GB) ?

Absolutely, I have used a P4 (8GB) for model training. However, the training speed might be quite slow.

How long does it take to train a new model,i need a 512x512 model with some new dataset.

I haven't run a complete training session using a similar GPU, but I can give you some references: currently, I use three RTX 3090 GPUs (24GB) to iterate 300,000 rounds, which takes 20 hours. I think using a single 12GB GPU to iterate 100,000 rounds might take 40 hours (time required for one iteration is less than 1 second).

shartoo commented 4 months ago

Thank you for your sharing! The training process looks good,i need to train a 512x512 model, which should be 4 times shorter time to train.I'll try and feedback!

shartoo commented 4 months ago

Can you share the email address of author of this repo? the address "hamza.pehlivan@bilkent.edu.tr " from the paper seems invalid.

taluos commented 4 months ago

Can you share the email address of author of this repo? the address "hamza.pehlivan@bilkent.edu.tr " from the paper seems invalid.

This is the correct email address. You might need to wait for a while until the author responds (it may take up to a week).

shartoo commented 4 months ago

i'm sending with gmail, it shows invalid email address 230

taluos commented 4 months ago

i'm sending with gmail, it shows invalid email address 230

I used my QQ email to send the email. image image

shartoo commented 4 months ago

Still failed to send even with QQ Mail 18

shartoo commented 4 months ago

My gmail is shartoo518@gmail.com, would you mind forwarding me a copy of the e-mail?

hamzapehlivan commented 4 months ago

@shartoo My previous email is closed, so I sent you from another one.

hamzapehlivan commented 4 months ago

Hello, I appreciate your feedback and thank you for the training code you sent me via email. After further training, I have some additional questions:

1:After 500,000 iterations of training the model, I achieved an FID score of 11.4 on CelebA, which is good progress, but still quite far from the 7 reported in the paper. My question is: approximately how many iterations are needed to achieve similar results as in the paper?

2:If I want to conduct ablation experiments, such as removing E1 or E2 individually, how should I proceed?

1-) FID is a very sensitive metric to resizing method, image format (JPG/PNG) and other things as well. Please see this link for detailed explanation.

In this repo, we also shared the exact code to reproduce the FID results. After you save the model coming from the training code, load it from this repo, and save all the images (with resizing, they should be 256x256, we have a --resize option in this repo). Then, run the provided fid.sh file.

2-) You should remove either E1 or E2 in the training code and let it run. Unfortunately, there is no flag to control which encoders are used.

I think you already trained the model, but there might be problems with FID calculations.

shartoo commented 4 months ago

Some pretrained model is missing from the training code, i dont know if i found the correct source

code from styleres_cfg.py

gan_model_path = 'checkpoints/stylegan2_official_ffhq1024.pth'
discriminator_model_path = 'checkpoints/stylegan2_official_ffhq256.pth'
perceptual_model_path = 'checkpoints/vgg16.pth'
arcface_path = 'checkpoints/arcface.pth'
hamzapehlivan commented 4 months ago

We used the same VGG network used in genforce. Here is the link for the weights.

Here is the arcface. It is also used in HyperStyle and pSp.

hamzapehlivan commented 4 months ago

Hello, I appreciate your feedback and thank you for the training code you sent me via email. After further training, I have some additional questions: 1:After 500,000 iterations of training the model, I achieved an FID score of 11.4 on CelebA, which is good progress, but still quite far from the 7 reported in the paper. My question is: approximately how many iterations are needed to achieve similar results as in the paper? 2:If I want to conduct ablation experiments, such as removing E1 or E2 individually, how should I proceed?

1-) FID is a very sensitive metric to resizing method, image format (JPG/PNG) and other things as well. Please see this link for detailed explanation.

In this repo, we also shared the exact code to reproduce the FID results. After you save the model coming from the training code, load it from this repo, and save all the images (with resizing, they should be 256x256, we have a --resize option in this repo). Then, run the provided fid.sh file.

2-) You should remove either E1 or E2 in the training code and let it run. Unfortunately, there is no flag to control which encoders are used.

I think you already trained the model, but there might be problems with FID calculations.

One more thing to consider is, you do not have to follow our FID calculation directly. If you apply the same preprocessing/FID network etc. to all methods, their relative order should not change.

If your model performs better than the all other methods with your FID implementation, it will probably be the best with our implementation as well.

phuongpropk05 commented 3 months ago

dear author, I dont understand the name field for each column in ganspace_config.csv file, can you give me the detail for it. And can you give me more parameter of others styles. Thank you. Screenshot from 2024-07-17 16-44-26

shartoo commented 3 months ago

The detail of GANSpace

phuongpropk05 commented 3 months ago

@shartoo can you forward me the training code beacause I dont know the email of the author. My email is hoangphuong070501@gmail.com. Thank you!

hkchae96 commented 2 months ago

@hamzapehlivan @shartoo Could I also request the training code? I had the same problem with your invalid email address. My email is hkchae96@gmail.com. Thank you.

shartoo commented 2 months ago

@hamzapehlivan @shartoo Could I also request the training code? I had the same problem with your invalid email address. My email is hkchae96@gmail.com. Thank you.

Better ask the author to send the code, I'm not authorized to send

taluos commented 1 month ago

@hamzapehlivan I'm trying to use test.sh to generate images, but I found that I don't have the edit_configs.py file required by test.py. This file wasn't used during the training process either. Could you provide that file to me? parser.add_argument('--edit_cfg', type=str, default='configs/edit_configs.py', help='Launcher type.')