MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestKornia

Class TestKornia

tests/test_kornia.py:7–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import kornia
6
7class TestKornia(unittest.TestCase):
8 def test_imread_opencv(self):
9 img = cv2.imread('/input/tests/data/dot.png')
10 img_t = kornia.image.image_to_tensor(img)
11
12 self.assertEqual(img.shape, (1, 1, 3))
13 self.assertEqual(img_t.shape, (3, 1, 1))
14
15 def test_grayscale_torch(self):
16 img_rgb = torch.rand(2, 3, 4, 5)
17 img_gray = kornia.color.rgb_to_grayscale(img_rgb)
18
19 self.assertEqual(img_gray.shape, (2, 1, 4, 5))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected