fahadshamshad / Clip2Protect

[CVPR 2023] Official repository of paper titled "CLIP2Protect: Protecting Facial Privacy using Text-Guided Makeup via Adversarial Latent Search".
https://fahadshamshad.github.io/Clip2Protect/
98 stars 12 forks source link

Identity preserving latent codes #2

Closed zhang-lie closed 1 year ago

zhang-lie commented 1 year ago

Your work is awesome. I have one question, in the paper it is mentioned that the optimization is over some identity preserving latent codes but from the code below it seems that requires_grad=True for all these latent codes and all are going in the optimizer. so are all getting updated?

https://github.com/fahadshamshad/Clip2Protect/blob/8596a82cd04a1c85ecc6a805daa2d2710d85de96/adversarial_optimization.py#L215C18-L215C18

fahadshamshad commented 1 year ago

Thanks. Despite all latent codes set to requires_grad=True, only identity-preserving ones are updated. This is enforced here.