6a4fa82792bddc6126eaf944956f49f0a0cb7ca7,kornia/filters/sobel.py,,sobel,#Any#Any#Any#,199

Before Change



    See :class:`~kornia.filters.Sobel` for details.
    
    return Sobel(normalized, eps)(input)

After Change


        >>> output.shape
        torch.Size([1, 3, 4, 4])
    
    if not isinstance(input, torch.Tensor):
        raise TypeError("Input type is not a torch.Tensor. Got {}"
                        .format(type(input)))

    if not len(input.shape) == 4:
        raise ValueError("Invalid input shape, we expect BxCxHxW. Got: {}"
                         .format(input.shape))

    // comput the x/y gradients
    edges: torch.Tensor = spatial_gradient(input, normalized=normalized)

    // unpack the edges
    gx: torch.Tensor = edges[:, :, 0]
    gy: torch.Tensor = edges[:, :, 1]

    // compute gradient maginitude
    magnitude: torch.Tensor = torch.sqrt(gx * gx + gy * gy + eps)

    return magnitude


class SpatialGradient(nn.Module):
    rComputes the first order image derivative in both x and y using a Sobel
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: kornia/filters/sobel.py
Class Name:
Method Name: sobel


Project Name: open-mmlab/mmcv
Commit Name: 45111e193daebbaa8137a9ac80ad8dc911a6b96c
Time: 2020-04-30
Author: chenkaidev@gmail.com
File Name: mmcv/utils/registry.py
Class Name: Registry
Method Name: register_module


Project Name: biocore/scikit-bio
Commit Name: 81d92544f48857e679b2670107bb8139b02d01d5
Time: 2014-09-11
Author: jai.rideout@gmail.com
File Name: skbio/sequence/_sequence.py
Class Name: BiologicalSequence
Method Name: __getitem__