2f49884ff8169422cbb711e18e94464efc59789c,torchgeometry/core/pinhole.py,,normalize_pixel_coordinates,#Any#Any#Any#,603

Before Change


    Return:
        torch.Tensor: the nornmalized pixel coordinates.
    
    if len(pixel_coordinates.shape) != 4 and pixel_coordinates.shape[-1] != 2:
        raise ValueError("Input pixel_coordinates must be of shape BxHxWx2. "
                         "Got {}".format(pixel_coordinates.shape))

    // unpack pixel coordinates
    u_coord, v_coord = torch.chunk(pixel_coordinates, dim=-1, chunks=2)

After Change


                         "Got {}".format(pixel_coordinates.shape))

    // compute normalization factor
    hw: torch.Tensor = torch.stack([
        torch.tensor(width), torch.tensor(height)]
    ).to(pixel_coordinates.device).to(pixel_coordinates.dtype)

    factor: torch.Tensor = torch.tensor(2.) / (hw - torch.tensor(1.))

    // normalize coordinates and return
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: arraiy/torchgeometry
Commit Name: 2f49884ff8169422cbb711e18e94464efc59789c
Time: 2019-05-04
Author: edgar.riba@gmail.com
File Name: torchgeometry/core/pinhole.py
Class Name:
Method Name: normalize_pixel_coordinates


Project Name: arraiy/torchgeometry
Commit Name: 2210302864058ac1ecef154a2b0d482448b74233
Time: 2018-10-04
Author: edgar.riba@gmail.com
File Name: torchgeometry/conversions.py
Class Name:
Method Name: convert_points_to_homogeneous


Project Name: arraiy/torchgeometry
Commit Name: dac6839364405ff932bc33a5ca7845cba4f8b4ce
Time: 2019-10-07
Author: edgar.riba@gmail.com
File Name: kornia/color/adjust.py
Class Name:
Method Name: adjust_brightness