oawiles / X2Face

Pytorch code for ECCV 2018 paper
MIT License
246 stars 60 forks source link

Question about the interpolation function #31

Closed RegisWu closed 4 years ago

RegisWu commented 4 years ago

Thanks for sharing this interesting work! I tried the train_model.py by myself and obtained good reconstructed results!

However, when I want to learn more details from your source code, I got stuck in the interpolation function (L37 in UnwrappedFace.py).

I am wondering why you added xs to the sampler in the interpolated function, rather than directly use the sampler as the index to generate the unwarpped image (I tried to remove xs but got very bad results). Is there a formula suggesting doing so?

https://github.com/oawiles/X2Face/blob/201d4f4c1dfa8a61cc15951f1ccb9389a22ce904/UnwrapMosaic/UnwrappedFace.py#L37

Look forward to your response!

RegisWu commented 4 years ago

I guess I have found the answer. The sampler predicted by your function is actually the residual (dx, dy) of the warping. So the final warping is (x+dx, y+dy).