060dfe2da846c7168f98dd9f46f47308e4317a9d,test/color/test_hls.py,TestHlsToRgb,test_batch_hls_to_rgb,#TestHlsToRgb#,122

Before Change



    def test_batch_hls_to_rgb(self):

        expected = torch.tensor([[[21., 22.],
                                  [22., 22.]],

                                 [[13., 14.],
                                  [14., 14.]],

                                 [[8., 8.],
                                  [8., 8.]]])  // 3x2x2

        data = torch.tensor([[[0.0641, 0.07138],
                              [0.07138, 0.07138]],

                             [[0.0569, 0.0588],
                              [0.0588, 0.0588]],

                             [[0.4483, 0.4667],
                              [0.4667, 0.4667]]])  // 3x2x2

        f = kornia.color.HlsToRgb()
        data = data.repeat(2, 1, 1, 1)  // 2x3x2x2

After Change



    def test_batch_hls_to_rgb(self):

        data = torch.rand(3,5,5)

        // OpenCV
        data_cv = data.numpy().transpose(1, 2, 0).copy()
        data_cv[:,:,0] = 360*data_cv[:,:,0]
        expected = cv2.cvtColor(data_cv, cv2.COLOR_HLS2RGB)

        expected = expected.transpose(2,0,1)

        // Kornia
        f = kornia.color.HlsToRgb()

        data[0] = 2*pi*data[0]
        data = data.repeat(2, 1, 1, 1)  // 2x3x2x2

        expected = np.expand_dims(expected,0)
        expected = expected.repeat(2, 0)  // 2x3x2x2

        assert_allclose(f(data), expected)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 30

Instances


Project Name: arraiy/torchgeometry
Commit Name: 060dfe2da846c7168f98dd9f46f47308e4317a9d
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hls.py
Class Name: TestHlsToRgb
Method Name: test_batch_hls_to_rgb


Project Name: arraiy/torchgeometry
Commit Name: 060dfe2da846c7168f98dd9f46f47308e4317a9d
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hls.py
Class Name: TestHlsToRgb
Method Name: test_batch_hls_to_rgb


Project Name: arraiy/torchgeometry
Commit Name: 6a85646b6d99b92ba436b227ee04c7344bb1f72a
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hsv.py
Class Name: TestHsvToRgb
Method Name: test_batch_hsv_to_rgb


Project Name: arraiy/torchgeometry
Commit Name: 5e2f713a0601c85bb68723cd9e52a0884f517879
Time: 2019-11-13
Author: priba@cvc.uab.cat
File Name: test/color/test_hls.py
Class Name: TestRgbToHls
Method Name: test_batch_rgb_to_hls