XinyiYing / D3Dnet

Repository for "Deformable 3D Convolution for Video Super-Resolution", SPL, 2020
Apache License 2.0
305 stars 43 forks source link

对于代码有一些疑惑 #15

Open heiheihei-ops opened 3 years ago

heiheihei-ops commented 3 years ago

您好,请问以下代码段是什么意思呢?它的作用是什么? https://github.com/XinyiYing/D3Dnet/blob/f3ca2483d37430d113a0b920030d37d8b50c5006/code/dcn/modules/deform_conv.py#L150-L167

XinyiYing commented 3 years ago

这段代码的目的是降低网络的参数量,即当在三维卷积的空域进行变形,只需要生成通道维度为2N的offset(其中N为卷积核的尺寸)。然而,在可变形三维卷积的底层C和cuda代码中,输入的offset的通道维数需要为3N。因此,需要将通道维度为2N的offset补零成通道维度为3N,再进行运算。 This code aims to reduce the number of parameters. That is, when only perform deformation in the spatial domain, only an offset with 2N channels is generated (N is the size of the convolution kernel). However, the basic D3Dnet codes on “C” and “cuda” require that the input offset should have 3N channels. Therefore, we first pad the 2N channels offset to 3N channels offset, and then perform the subsequent operations.

heiheihei-ops commented 3 years ago

谢谢您的答复,请问您这边的dcn的底层C代码是在DCNv2的基础上改动的吗?

XinyiYing commented 3 years ago

是的,代码是基于[DCNv2]进行改进的。

heiheihei-ops commented 3 years ago

好的 谢谢您的答复