| 5 | import kornia |
| 6 | |
| 7 | class 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)) |
nothing calls this directly
no outgoing calls
no test coverage detected