| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -328,6 +328,7 @@ RUN pip install bcolz && \ | |||
| 328 | 328 | pip install notebook==5.5.0 && \ | |
| 329 | 329 | pip install olefile && \ | |
| 330 | 330 | pip install opencv-python && \ | |
| 331 | + pip install kornia && \ | ||
| 331 | 332 | pip install pandas_summary && \ | |
| 332 | 333 | pip install pandocfilters && \ | |
| 333 | 334 | pip install pexpect && \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + import unittest | ||
| 2 | + | ||
| 3 | + import cv2 | ||
| 4 | + import torch | ||
| 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_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.rgb_to_grayscale(img_rgb) | ||
| 18 | + | ||
| 19 | + self.assertEqual(img_gray.shape, (2, 1, 4, 5)) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments