wl-zhao / DiffSwap

[CVPR 2023] DiffSwap is a diffusion-based face-swapping framework.
99 stars 10 forks source link

Is the Cregion from source features or target features? #8

Open hengfei-wang opened 11 months ago

hengfei-wang commented 11 months ago

Hi,

Thank you for sharing the code.

I am curious whether the region condition is from source image or target image? The paper shows that it is from z0. Is z0 the embedding of target image? But the paper also shows "By combining cid and cregion, we are able to better leverage the identity information from both global and local levels." . I would think it should from source image to reveal id information. I also check the code and found

        if swap:
            batch['z_src'] = torch.roll(z, 1, 0)

I think z is from target image, right? Why just roll it and make it as z_src? I am confused. Look forward to your reply.

Thanks