How to use the torchgeometry.augmentation.Rotate function in torchgeometry

To help you get started, we’ve selected a few torchgeometry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kornia / kornia / test / test_augmentation.py View on Github external
def test_smoke(self):
        angle = 0.0
        angle_t = torch.Tensor([angle])
        assert str(taug.Rotate(angle=angle_t)) == 'Rotate(angle=0.0, center=None)'
github kornia / kornia / test / test_augmentation.py View on Github external
# prepare input data
        inp = torch.FloatTensor([[
            [1, 2],
            [3, 4],
            [5, 6],
            [7, 8],
        ]])
        expected = torch.FloatTensor([[
            [0, 0],
            [4, 6],
            [3, 5],
            [0, 0],
        ]])
        # prepare transformation
        angle_t = torch.Tensor([90])
        transform = taug.Rotate(angle_t)
        assert_allclose(transform(inp), expected)
github kornia / kornia / test / test_augmentation.py View on Github external
[7, 8],
        ]]).repeat(2, 1, 1, 1)
        expected = torch.FloatTensor([[[
            [0, 0],
            [4, 6],
            [3, 5],
            [0, 0],
        ]],[[
            [0, 0],
            [5, 3],
            [6, 4],
            [0, 0],
        ]]])
        # prepare transformation
        angle_t = torch.Tensor([90, -90])
        transform = taug.Rotate(angle_t)
        assert_allclose(transform(inp), expected)