π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
No jit tests, no crash after test failure
Dmytro Mishkin98044465e0ca
diff --git a/Makefile b/Makefileindex 8530986ce..9f1d70dc6 100644--- a/Makefile+++ b/Makefile@@ -3,13 +3,13 @@test: mypy lint test-cputest-cpu: FORCE- pytest --typetest cpu -vx+ pytest --typetest cpu -vtest-cpu-cov: FORCE- pytest --typetest cpu -vx --cov=kornia test+ pytest --typetest cpu -v --cov=kornia testtest-gpu: FORCE- pytest --typetest cuda -vx+ pytest --typetest cuda -vlint: FORCEpython verify.py --check lintdiff --git a/test/color/test_gray.py b/test/color/test_gray.pyindex f1ed242af..4a2ed1882 100644--- a/test/color/test_gray.py+++ b/test/color/test_gray.py@@ -27,6 +27,7 @@ class TestRgbToGrayscale:img = utils.tensor_to_gradcheck_var(img) # to varassert gradcheck(kornia.rgb_to_grayscale, (img,), raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):batch_size, channels, height, width = 2, 3, 64, 64img = torch.ones(batch_size, channels, height, width)diff --git a/test/color/test_hsv.py b/test/color/test_hsv.pyindex 1cc794e92..341cce647 100644--- a/test/color/test_hsv.py+++ b/test/color/test_hsv.py@@ -74,6 +74,7 @@ class TestRgbToHsv:assert gradcheck(kornia.color.RgbToHsv(), (data,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(data: torch.Tensor) -> torch.Tensor:@@ -143,6 +144,7 @@ class TestHsvToRgb:expected = expected.repeat(2, 1, 1, 1) # 2x3x2x2assert_allclose(f(data), expected / 255, atol=1e-3, rtol=1e-3)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(data: torch.Tensor) -> torch.Tensor:diff --git a/test/color/test_normalize.py b/test/color/test_normalize.pyindex 5c20b9185..2a64c3b4c 100644--- a/test/color/test_normalize.py+++ b/test/color/test_normalize.py@@ -59,6 +59,7 @@ class TestNormalize:f = kornia.color.Normalize(mean, std)assert_allclose(f(data), expected)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(data: torch.Tensor, mean: torch.Tensor,diff --git a/test/color/test_rgb.py b/test/color/test_rgb.pyindex a7a61b094..1cc957505 100644--- a/test/color/test_rgb.py+++ b/test/color/test_rgb.py@@ -95,6 +95,7 @@ class TestBgrToRgb:assert gradcheck(kornia.color.BgrToRgb(), (data,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(data: torch.Tensor) -> torch.Tensor:@@ -157,6 +158,7 @@ class TestRgbToBgr:assert gradcheck(kornia.color.RgbToBgr(), (data,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(data: torch.Tensor) -> torch.Tensor:diff --git a/test/feature/test_harris.py b/test/feature/test_harris.pyindex 00e7da633..ad1f98e25 100644--- a/test/feature/test_harris.py+++ b/test/feature/test_harris.py@@ -91,6 +91,7 @@ class TestCornerHarris:assert gradcheck(kornia.feature.corner_harris, (img, k),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input, k):diff --git a/test/filters/test_blur.py b/test/filters/test_blur.pyindex 3c5970a14..0481c3b68 100644--- a/test/filters/test_blur.py+++ b/test/filters/test_blur.py@@ -73,6 +73,7 @@ class TestBoxBlur:raise_exception=True)@pytest.mark.skip(reason="undefined value BoxBlur")+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.filters.box_blurop_script = torch.jit.script(op)diff --git a/test/filters/test_filters.py b/test/filters/test_filters.pyindex a31ec2462..68e5a0aa6 100644--- a/test/filters/test_filters.py+++ b/test/filters/test_filters.py@@ -67,6 +67,7 @@ class TestFilter2D:raise_exception=True)@pytest.mark.skip(reason="not found compute_padding()")+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.filter2Dop = torch.jit.script(op)diff --git a/test/filters/test_gaussian.py b/test/filters/test_gaussian.pyindex 61d44f3fb..2a63016de 100644--- a/test/filters/test_gaussian.py+++ b/test/filters/test_gaussian.py@@ -51,6 +51,7 @@ class TestGaussianBlur:raise_exception=True,)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(img):diff --git a/test/filters/test_median.py b/test/filters/test_median.pyindex 811d466fc..096eb3f4c 100644--- a/test/filters/test_median.py+++ b/test/filters/test_median.py@@ -49,6 +49,7 @@ class TestMedianBlur:raise_exception=True)@pytest.mark.skip("")+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor,diff --git a/test/filters/test_sobel.py b/test/filters/test_sobel.pyindex cffaece80..f04e20796 100644--- a/test/filters/test_sobel.py+++ b/test/filters/test_sobel.py@@ -46,6 +46,7 @@ class TestSpatialGradient:assert gradcheck(kornia.filters.spatial_gradient, (img,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):@@ -89,6 +90,7 @@ class TestSobel:img = utils.tensor_to_gradcheck_var(img) # to varassert gradcheck(kornia.filters.sobel, (img,), raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):diff --git a/test/geometry/test_conversions.py b/test/geometry/test_conversions.pyindex 1819a0e99..64fd2a49c 100644--- a/test/geometry/test_conversions.py+++ b/test/geometry/test_conversions.py@@ -119,6 +119,7 @@ class TestRotationMatrixToQuaternion:assert gradcheck(kornia.rotation_matrix_to_quaternion, (matrix,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.quaternion_log_to_expop_script = torch.jit.script(op)@@ -184,6 +185,7 @@ class TestQuaternionToRotationMatrix:assert gradcheck(kornia.quaternion_to_rotation_matrix, (quaternion,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):@@ -227,6 +229,7 @@ class TestQuaternionLogToExp:assert gradcheck(kornia.quaternion_log_to_exp, (quaternion,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.quaternion_log_to_expop_script = torch.jit.script(op)@@ -268,6 +271,7 @@ class TestQuaternionExpToLog:assert gradcheck(kornia.quaternion_exp_to_log, (quaternion,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.quaternion_exp_to_logop_script = torch.jit.script(op)@@ -420,6 +424,7 @@ class TestConvertPointsToHomogeneous:assert gradcheck(kornia.convert_points_to_homogeneous, (points_h,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.convert_points_to_homogeneousop_script = torch.jit.script(op)@@ -486,6 +491,7 @@ class TestConvertPointsFromHomogeneous:assert gradcheck(kornia.convert_points_from_homogeneous, (points_h,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.convert_points_from_homogeneousop_script = torch.jit.script(op)@@ -574,6 +580,7 @@ class TestNormalizePixelCoordinates:assert_allclose(grid_norm, expected)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.normalize_pixel_coordinatesop_script = torch.jit.script(op)@@ -617,6 +624,7 @@ class TestDenormalizePixelCoordinates:assert_allclose(grid_norm, expected)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):op = kornia.denormalize_pixel_coordinatesop_script = torch.jit.script(op)diff --git a/test/geometry/test_linalg.py b/test/geometry/test_linalg.pyindex bf506a9b0..79a06c755 100644--- a/test/geometry/test_linalg.py+++ b/test/geometry/test_linalg.py@@ -81,6 +81,7 @@ class TestTransformPoints:assert gradcheck(kornia.transform_points, (dst_homo_src, points_src,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(transform, points):diff --git a/test/geometry/test_perspective.py b/test/geometry/test_perspective.pyindex 12c6d21f1..2adfe2e3e 100644--- a/test/geometry/test_perspective.py+++ b/test/geometry/test_perspective.py@@ -51,6 +51,7 @@ class TestProjectPoints:(points_3d, camera_matrix),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(points_3d, camera_matrix):@@ -135,6 +136,7 @@ class TestUnprojectPoints:(points_2d, depth, camera_matrix),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(points_2d, depth, camera_matrix):diff --git a/test/geometry/transform/test_affine.py b/test/geometry/transform/test_affine.pyindex 512f5397a..6575e1701 100644--- a/test/geometry/transform/test_affine.py+++ b/test/geometry/transform/test_affine.py@@ -89,6 +89,7 @@ class TestRotate:assert gradcheck(kornia.rotate, (input, angle,), raise_exception=True)@pytest.mark.skip('Need deep look into it since crashes everywhere.')+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):angle = torch.tensor([90.])batch_size, channels, height, width = 2, 3, 64, 64@@ -179,6 +180,7 @@ class TestTranslate:raise_exception=True)@pytest.mark.skip('Need deep look into it since crashes everywhere.')+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):translation = torch.tensor([[1., 0.]])batch_size, channels, height, width = 2, 3, 64, 64@@ -272,6 +274,7 @@ class TestScale:raise_exception=True)@pytest.mark.skip('Need deep look into it since crashes everywhere.')+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):scale_factor = torch.tensor([0.5])batch_size, channels, height, width = 2, 3, 64, 64@@ -381,6 +384,7 @@ class TestShear:assert gradcheck(kornia.shear, (input, shear,), raise_exception=True)@pytest.mark.skip('Need deep look into it since crashes everywhere.')+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):shear = torch.tensor([[0.5, 0.0]])batch_size, channels, height, width = 2, 3, 64, 64diff --git a/test/geometry/transform/test_crop.py b/test/geometry/transform/test_crop.pyindex bc2ec2d7b..6514db772 100644--- a/test/geometry/transform/test_crop.py+++ b/test/geometry/transform/test_crop.py@@ -123,6 +123,7 @@ class TestCropAndResize:(img, boxes, (crop_height, crop_width),),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor,@@ -223,6 +224,7 @@ class TestCenterCrop:assert gradcheck(kornia.center_crop, (img, (crop_height, crop_width),),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor,diff --git a/test/geometry/transform/test_imgwarp.py b/test/geometry/transform/test_imgwarp.pyindex 55da4c3dc..1aa7abdb4 100644--- a/test/geometry/transform/test_imgwarp.py+++ b/test/geometry/transform/test_imgwarp.py@@ -363,6 +363,7 @@ class TestRemap:assert gradcheck(kornia.remap, (img, grid[..., 0], grid[..., 1],),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input, map1, map2):@@ -443,6 +444,7 @@ class TestInvertAffineTransform:assert gradcheck(kornia.invert_affine_transform, (matrix,),raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):diff --git a/test/geometry/transform/test_pyramid.py b/test/geometry/transform/test_pyramid.pyindex 79395e429..c29236028 100644--- a/test/geometry/transform/test_pyramid.py+++ b/test/geometry/transform/test_pyramid.py@@ -26,6 +26,7 @@ class TestPyrUp:assert gradcheck(kornia.geometry.pyrup, (img,), raise_exception=True)@pytest.mark.skip("")+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):@@ -61,6 +62,7 @@ class TestPyrDown:assert gradcheck(kornia.geometry.pyrdown, (img,), raise_exception=True)@pytest.mark.skip("")+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input):diff --git a/test/test_contrib.py b/test/test_contrib.pyindex 892b0182b..1fc753e8c 100644--- a/test/test_contrib.py+++ b/test/test_contrib.py@@ -25,6 +25,7 @@ class TestMaxBlurPool2d:assert gradcheck(kornia.contrib.max_blur_pool2d,(input, 3,), raise_exception=True)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor, kernel_size: int) -> torch.Tensor:@@ -137,6 +138,7 @@ class TestExtractTensorPatches:assert_allclose(input[0, :, 1:3, 0:3], patches[0, 2])assert_allclose(input[0, :, 1:3, 1:4], patches[0, 3])+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor, height: int,@@ -219,6 +221,7 @@ class TestSpatialSoftArgmax2d:assert pytest.approx(coord[1, 1, 0].item(), 1.0) # bottom-rightassert pytest.approx(coord[1, 1, 1].item(), 1.0)+ @pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdef op_script(input: torch.Tensor,