neuralchen / SimSwap

An arbitrary face-swapping framework on images and videos with one single trained model!
Other
4.55k stars 895 forks source link

How to train the model? #268

Open sdasdasddaaaa opened 2 years ago

sdasdasddaaaa commented 2 years ago

Hello everyone, I have downloaded the source code, how can I train the model?thank you!

BeaverInGreenland commented 2 years ago

Hello, have you tried to follow these steps ? https://github.com/neuralchen/SimSwap#training

SerZhyAle commented 2 years ago

friends! Still not sure why we have to train? What is the point if we have already pretrained models published year ago? It can give some best results within the particular face? Can I see some samples/examples?

BeaverInGreenland commented 2 years ago

If I'm not wrong, the pretrained weights come from a training on either vggface2-224 (people folder in checkpoints/) or vggface2-hq (512 folder in checkpoints/) The point of training is to change the dataset for example

chenqiu1024 commented 1 year ago

Same question. I trained my model for 400K+ steps following these steps: https://github.com/neuralchen/SimSwap#training. What I don't get is how to use the trained results? All I found is that, for each saving, there are 4 files generated in the ./checkpoints/MyModelName folder, like: 30000_net_D.pth, 30000_net_G.pth, 30000_optim_D.pth, 30000_optim_G.pth. However, the model files needed by the inferencing process are: latest_net_D1.pth, latest_net_D2.pth and latest_net_G.pth. So, how do I get these 3 files from my training results?

Fibonacci134 commented 1 year ago

Same question. I trained my model for 400K+ steps following these steps: https://github.com/neuralchen/SimSwap#training. What I don't get is how to use the trained results? All I found is that, for each saving, there are 4 files generated in the ./checkpoints/MyModelName folder, like: 30000_net_D.pth, 30000_net_G.pth, 30000_optim_D.pth, 30000_optim_G.pth. However, the model files needed by the inferencing process are: latest_net_D1.pth, latest_net_D2.pth and latest_net_G.pth. So, how do I get these 3 files from my training results?

Can you post the model? You have to make some changes in the models layers to get it to work.

chenqiu1024 commented 1 year ago

Same question. I trained my model for 400K+ steps following these steps: https://github.com/neuralchen/SimSwap#training. What I don't get is how to use the trained results? All I found is that, for each saving, there are 4 files generated in the ./checkpoints/MyModelName folder, like: 30000_net_D.pth, 30000_net_G.pth, 30000_optim_D.pth, 30000_optim_G.pth. However, the model files needed by the inferencing process are: latest_net_D1.pth, latest_net_D2.pth and latest_net_G.pth. So, how do I get these 3 files from my training results?

Can you post the model? You have to make some changes in the models layers to get it to work.

How to post the model? Do you mean the .pth files?

chenqiu1024 commented 1 year ago

Same question. I trained my model for 400K+ steps following these steps: https://github.com/neuralchen/SimSwap#training. What I don't get is how to use the trained results? All I found is that, for each saving, there are 4 files generated in the ./checkpoints/MyModelName folder, like: 30000_net_D.pth, 30000_net_G.pth, 30000_optim_D.pth, 30000_optim_G.pth. However, the model files needed by the inferencing process are: latest_net_D1.pth, latest_net_D2.pth and latest_net_G.pth. So, how do I get these 3 files from my training results?

Can you post the model? You have to make some changes in the models layers to get it to work.

The files are too big, they all exceed the 25MB limit. I'll try using some internet storage service.

chenqiu1024 commented 1 year ago

Same question. I trained my model for 400K+ steps following these steps: https://github.com/neuralchen/SimSwap#training. What I don't get is how to use the trained results? All I found is that, for each saving, there are 4 files generated in the ./checkpoints/MyModelName folder, like: 30000_net_D.pth, 30000_net_G.pth, 30000_optim_D.pth, 30000_optim_G.pth. However, the model files needed by the inferencing process are: latest_net_D1.pth, latest_net_D2.pth and latest_net_G.pth. So, how do I get these 3 files from my training results?

Can you post the model? You have to make some changes in the models layers to get it to work.

I have uploaded the 4 model files of my 330000th epoch to dropbox, please check them out @Fibonacci134 : https://www.dropbox.com/scl/fo/n03aggt78lbpoqwubae4d/h?dl=0&rlkey=oecxeiqmhh79804xa2nifw4ca

OlofOu commented 1 year ago

Hi @chenqiu1024, I am really struggled in this problem as well, since it seems to have two discriminaters when loading pretrained models to swap face. Did you solve this problem? Would you mind to share how you conquer this issue?Thanks in advance.