π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Fixed video batching bug #2410 #2497 (#2502)
Jian Shi8427ccc5e283
diff --git a/kornia/augmentation/container/video.py b/kornia/augmentation/container/video.pyindex d5704fa7a..bb80a70bd 100644--- a/kornia/augmentation/container/video.py+++ b/kornia/augmentation/container/video.py@@ -331,8 +331,7 @@ class VideoSequential(ImageSequential):raise AssertionError(f"Input must be a 5-dim tensor. Got {input.shape}.")if params is None:- if self._params is None:- self._params = self.forward_parameters(input.shape)+ self._params = self.forward_parameters(input.shape)params = self._paramsoutput = self.transform_inputs(input, params, extra_args=extra_args)diff --git a/test/augmentation/test_container.py b/test/augmentation/test_container.pyindex e8f99695a..1f7c09f16 100644--- a/test/augmentation/test_container.py+++ b/test/augmentation/test_container.py@@ -38,6 +38,13 @@ def reproducibility_test(input, seq):class TestVideoSequential:+ def test_smoke(self, device, dtype):+ input_1 = torch.randn(2, 3, 1, 5, 6, device=device, dtype=dtype).repeat(1, 1, 3, 1, 1)+ input_2 = torch.randn(4, 3, 1, 5, 6, device=device, dtype=dtype).repeat(1, 1, 3, 1, 1)+ aug_list = K.VideoSequential(K.ColorJiggle(0.1, 0.1, 0.1, 0.1))+ aug_list(input_1)+ aug_list(input_2)+@pytest.mark.parametrize('shape', [(3, 4), (2, 3, 4), (2, 3, 5, 6), (2, 3, 4, 5, 6, 7)])@pytest.mark.parametrize('data_format', ["BCTHW", "BTCHW"])def test_exception(self, shape, data_format, device, dtype):