contextnet/models/models.py
def _get_local_maximum(self, heat, kernel=3):
        """Extract local maximum pixel with given kernal.
        Args:
            heat (Tensor): Target heatmap.
            kernel (int): Kernel size of max pooling. Default: 3.
        Returns:
            heat (Tensor): A heatmap where local maximum pixels maintain its
                own value and other positions are 0.
        """
        pad = (kernel - 1) // 2
        hmax = F.max_pool2d(heat, kernel, stride=1, padding=pad)
        keep = (hmax == heat).float()
        return heat * keep
Extract local maximum pixel with given kernal.
        Args:
            heat (Tensor): Target heatmap.
            kernel (int): Kernel size of max pooling. Default: 3.
        Returns:
            heat (Tensor): A heatmap where local maximum pixels maintain its
                own value and other positions are 0.
        
Extract local maximum pixel with given kernal.
Extract local maximum pixel with given kernal .
def _get_local_maximum(self, heat, kernel=3):
        pad = (kernel - 1) // 2
        hmax = F.max_pool2d(heat, kernel, stride=1, padding=pad)
        keep = (hmax == heat).float()
        return heat * keep
def _get_local_maximum ( self , heat , kernel = 3 ) : pad = ( kernel - 1 ) // 2 hmax = F . max_pool2d ( heat , kernel , stride = 1 , padding = pad ) keep = ( hmax == heat ) . float ( ) return heat * keep
Extract local maximum pixel with given kernal.
Extract local maximum pixel with given kernal .
"""Extract local maximum pixel with given kernal.
        Args:
            heat (Tensor): Target heatmap.
            kernel (int): Kernel size of max pooling. Default: 3.
        Returns:
            heat (Tensor): A heatmap where local maximum pixels maintain its
                own value and other positions are 0.
        """
heat (Tensor): A heatmap where local maximum pixels maintain its
own value and other positions are 0.
heat ( Tensor ) : A heatmap where local maximum pixels maintain its own value and other positions are 0 .
self
heat
None
kernel
Kernel size of max pooling. Default: 3.
Kernel size of max pooling . Default : 3 .