Skip to content

Commit b327c0d

Browse files
authored
Merge pull request #795 from edgarriba/master
add kornia to dockerfile
2 parents 77ab464 + 81bb5a5 commit b327c0d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ RUN pip install bcolz && \
328328
pip install notebook==5.5.0 && \
329329
pip install olefile && \
330330
pip install opencv-python && \
331+
pip install kornia && \
331332
pip install pandas_summary && \
332333
pip install pandocfilters && \
333334
pip install pexpect && \

tests/test_kornia.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)