oeway / pytorch-deform-conv

PyTorch implementation of Deformable Convolution
MIT License
911 stars 151 forks source link

Weighting in deformed kernel #19

Open mbcel opened 5 years ago

mbcel commented 5 years ago

I am a little bit confused how the weighting is done of each input element of the deformed kernel in your implementation.

In your implementation it looks like you are first calculating the offsets and with these rearrange the input in the ConvOffset2D module (so ConvOffset2D just outputs the rearranged features according to the learned offsets). After that, on the rearranged feature maps you apply a normal Conv2D, which should then do the actual weighting for the deformed kernel, right?

Is this the same as in the original paper where I understand it that way that the weighting is applied directly to the deformed input elements (kernel elements with offsets) , like

sum_p_n[ w(p_n) * x(p_0 + p_n + p_delta)]

I don't see if this is the same or if this has a different assumption on deformable confolutions than the original paper.