def interpolate_2d_features(features):
out_size = feature_size
x = np.arange(features.shape[0])
y = np.arange(features.shape[1])
z = features
xx = np.linspace(x.min(), x.max(), out_size)
yy = np.linspace(y.min(), y.max(), out_size)
new_kernel = interpolate.RectBivariateSpline(x, y, z, kx=1, ky=1)
kernel_out = new_kernel(xx, yy)
return kernel_out
# Interpolation 2d of each channel, so we obtain 3d interpolated feature maps
评论列表
文章目录