avg_pool2d_valid#
- rlemasklib.RLEMask.avg_pool2d_valid(kernel_size, stride=(1, 1), threshold=-1)[source]#
Perform a 2D average pooling with the given kernel size and threshold the result.
This function does not perform any padding and only returns the “valid” part of the pooling, similar to “valid” padding mode in deep learning frameworks as opposed to “same” or “full” padding.
- Parameters:
- Returns:
A new RLEMask object representing the pooled and thresholded mask.
- Return type:
Examples
3x3 kernel with stride 2 pools down to smaller size:
.avg_pool2d_valid((3, 3), stride=(2, 2)) ==See also