harlanhong / CVPR2022-DaGAN

Official code for CVPR2022 paper: Depth-Aware Generative Adversarial Network for Talking Head Video Generation
https://harlanhong.github.io/publications/dagan.html
Other
964 stars 126 forks source link

how to load SPADEGenerator model weight seperately? #23

Closed Joshi21787 closed 2 years ago

Joshi21787 commented 2 years ago

I want to utilise SPADEGenerator separately and want to know how to load it's weight separately..Please help.

harlanhong commented 2 years ago

Please use the command like this: CUDA_VISIBLE_DEVICES=0 python demo.py --config config/vox-adv-256.yaml --driving_video source/example.mp4 --source_image source/example.png --checkpoint download/SPADE_DaGAN_vox_adv_256.pth.tar --kp_num 15 --generator SPADEDepthAwareGenerator --result_video results/example_out.mp4 --relative --adapt_scale --find_best_frame

Joshi21787 commented 2 years ago

Thank you sir for your prompt reply, but I think I am not able to explain my problem. I want to use SPADE decoder model only not along with the generator. When I use SPADEDepthAwareGenerator it will load generator along with SPADE decoder. But I do not want to use depth aware generator. I want to use decoder only.

harlanhong commented 2 years ago

If you need to use the weights of SPADEGenerator only, you can filter other irrelevant parameters, like this: ckp_decoder = OrderedDict((k,v) for k,v in checkpoint['generator'].items() if 'decoder' in k)