Closed carter54 closed 3 years ago
The box filter could have some difference on the edge of the image. But if you compare the center of the image they should be the same.
Another way to implement box filter is to use AvgPool2d with stride 1. That effectively blurs the image. AvgPool2d can also set count_include_pad=False
to get accurate blur at the edge.
@PeterL1n I see, thx for the reply~, I think AvgPool2d should be the most efficient way to implement the box filter.
Hi Peter, thx for such a nice project.
I have a question about the fast guilded filter implemented in the model.
I saw you modified the boxfilter from the original:
original one: https://github.com/wuhuikai/DeepGuidedFilter/blob/0caaf2d78e2333ccbd7fcb01dafa685cad98f1b1/GuidedFilteringLayer/GuidedFilter_PyTorch/guided_filter_pytorch/box_filter.py#L26
yours: https://github.com/PeterL1n/RobustVideoMatting/blob/48effc91576a9e0e7a8519f3da687c0d3522045f/model/fast_guided_filter.py#L62
I did a simple test by randomly initializing three input tensors:
but the results are totally different. Did I make something wrong here?