MarekKowalski / DeepAlignmentNetwork

A deep neural network for face alignment
MIT License
509 stars 138 forks source link

question about AffineTransformLayer.py #4

Open hzh8311 opened 7 years ago

hzh8311 commented 7 years ago

hi, in my view, the AffineTransformLayer.py is used to apply the affine/similiarity transform on original training image, but why the affine transform matrix be inversed in lines 59-60?

hzh8311 commented 7 years ago

@MarekKowalski

MarekKowalski commented 7 years ago

Hi,

Yes, that is the purpose of the AffineTransformLayer. Let's say transform parameters given to that layer transform A into B. What the layer does is generate image B based on image A. To do that the layer finds the location of each pixel of image B in image A. To do that the transform needs to be inversed.

If the layer did the opposite, take each pixel in A and transform it into B, we would end up with holes in image B.

Does that explain the problem a bit?

Best regards,

Marek

mariolew commented 6 years ago

@MarekKowalski Still confused, can you share some paper or blog, or explain a bit more?

Best, Lew

MarekKowalski commented 6 years ago

Hi,

What is the thing that confuses you exactly? Is it the reason why the layer is used, or is it something else?

You can take a look at the article describing Deep Alignment Network, here: https://arxiv.org/abs/1706.01789 where the idea behind this layer is explained.

Marek

mariolew commented 6 years ago

@MarekKowalski Now, I figure it out, thanks.

Lew