oeway / pytorch-deform-conv

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

Offset output channel #13

Closed zhujiagang closed 6 years ago

zhujiagang commented 6 years ago

https://github.com/oeway/pytorch-deform-conv/blob/e7a664f1e868f254d758e1cde11d82ea66972aa4/torch_deform_conv/layers.py#L33 Your implementation is not the same as the original paper described in section 2.1. Offset output channel dimension should be 2 x N, where N is the conv kernel size k*k in 2D case. That is, the offset is shared across the channel dimension. You could refer to the implementation of https://github.com/ChunhuanLin/deform_conv_pytorch

oeway commented 6 years ago

This is known, and discussed here: https://github.com/felixlaumon/deform-conv/issues/4

Please also notice that this implementation is done before the original author release the code. And Felix made a nice blog to introduce the idea which I found it’s very helpful.

Besides, I don’t think having a different deformation on each channel is completely ruin the result, it will just add more freedom to the deformation. If necessary, backprop should find the same deformation for each channel itself.

Plus, I can think of cases which will be good to have different deformation, for example “chromatic aberration”.

I will close this issue for now, if you could run some test case to show a clear difference on performance, I would be happy to reopen it and add the option to limit the channel deformation.