6a85646b6d99b92ba436b227ee04c7344bb1f72a,test/color/test_hsv.py,TestHsvToRgb,test_batch_hsv_to_rgb,#TestHsvToRgb#,149
Before Change
def test_batch_hsv_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.0714],
[0.0714, 0.0714]],
[[0.6190, 0.6364],
[0.6364, 0.6364]],
[[21.0000 / 255, 22.0000 / 255],
[22.0000 / 255, 22.0000 / 255]]]) // 3x2x2
f = kornia.color.HsvToRgb()
data = data.repeat(2, 1, 1, 1) // 2x3x2x2
After Change
def test_batch_hsv_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_HSV2RGB)
expected = expected.transpose(2,0,1)
// Kornia
f = kornia.color.HsvToRgb()
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)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 24
Instances
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
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