docstr: Using convolution for box blur like RVM: <https://github.com/PeterL1n/RobustVideoMatting/>
  The original implementation: <https://github.com/wuhuikai/DeepGuidedFilter/>
docstr_tok: ["Using","convolution","for","box","blur","like","RVM",":","<","https",":","\/\/github.com\/PeterL1n\/RobustVideoMatting\/",">","The","original","implementation",":","<","https",":","\/\/github.com\/wuhuikai\/DeepGuidedFilter\/",">"]
code: def forward(self, x):
      """
      Using convolution for box blur like RVM: <https://github.com/PeterL1n/RobustVideoMatting/>
      The original implementation: <https://github.com/wuhuikai/DeepGuidedFilter/>
      """
      kernel_size = 2 * self.r + 1
      kernel_x = paddle.full(
          (x.shape[1], 1, 1, kernel_size), 1 / kernel_size
      )
      kernel_y = paddle.full(
          (x.shape[1], 1, kernel_size, 1), 1 / kernel_size
      )
      x = F.conv2d(x, kernel_x, padding=(0, self.r), groups=x.shape[1])
      x = F.conv2d(x, kernel_y, padding=(self.r, 0), groups=x.shape[1])
  
      return x
  
file_path: PaddleSeg/Matting/ppmatting/models/layers/guided_filter.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 2 for calling the BoxFilter obj's underlying member method code with example usage: obj.forward(x) and returns: x