Loading imgutils/preprocess/pillow.py +1 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,7 @@ class PillowResize: if isinstance(size, (list, tuple)) and len(size) not in (1, 2): raise ValueError("If size is a sequence, it should have 1 or 2 values") if max_size is not None and isinstance(size, (list, tuple)) and len(size) != 1: raise ValueError( "max_size is only supported for single int size or sequence of length 1" ) raise ValueError("max_size is only supported for single int size or sequence of length 1") # noinspection PyTypeChecker self.size = size Loading test/preprocess/test_pillow.py +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ class TestPreprocessPillow: _ = PillowResize(size=()) with pytest.raises(ValueError): _ = PillowResize(size=(1, 1, 4, 5, 1, 4)) with pytest.raises(ValueError): _ = PillowResize(size=(224, 384), max_size=512) def test_resize_invalid_input(self): resize = PillowResize(size=640) Loading Loading
imgutils/preprocess/pillow.py +1 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,7 @@ class PillowResize: if isinstance(size, (list, tuple)) and len(size) not in (1, 2): raise ValueError("If size is a sequence, it should have 1 or 2 values") if max_size is not None and isinstance(size, (list, tuple)) and len(size) != 1: raise ValueError( "max_size is only supported for single int size or sequence of length 1" ) raise ValueError("max_size is only supported for single int size or sequence of length 1") # noinspection PyTypeChecker self.size = size Loading
test/preprocess/test_pillow.py +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ class TestPreprocessPillow: _ = PillowResize(size=()) with pytest.raises(ValueError): _ = PillowResize(size=(1, 1, 4, 5, 1, 4)) with pytest.raises(ValueError): _ = PillowResize(size=(224, 384), max_size=512) def test_resize_invalid_input(self): resize = PillowResize(size=640) Loading