Skip to content

Commit c3e9256

Browse files
authored
fix PIL version check (#7716)
1 parent 43030cb commit c3e9256

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

test/test_transforms.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -952,33 +952,6 @@ def test_adjust_contrast():
952952
torch.testing.assert_close(y_np, y_ans)
953953

954954

955-
@pytest.mark.skipif(Image.__version__ >= "7", reason="Temporarily disabled")
956-
def test_adjust_saturation():
957-
x_shape = [2, 2, 3]
958-
x_data = [0, 5, 13, 54, 135, 226, 37, 8, 234, 90, 255, 1]
959-
x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape)
960-
x_pil = Image.fromarray(x_np, mode="RGB")
961-
962-
# test 0
963-
y_pil = F.adjust_saturation(x_pil, 1)
964-
y_np = np.array(y_pil)
965-
torch.testing.assert_close(y_np, x_np)
966-
967-
# test 1
968-
y_pil = F.adjust_saturation(x_pil, 0.5)
969-
y_np = np.array(y_pil)
970-
y_ans = [2, 4, 8, 87, 128, 173, 39, 25, 138, 133, 215, 88]
971-
y_ans = np.array(y_ans, dtype=np.uint8).reshape(x_shape)
972-
torch.testing.assert_close(y_np, y_ans)
973-
974-
# test 2
975-
y_pil = F.adjust_saturation(x_pil, 2)
976-
y_np = np.array(y_pil)
977-
y_ans = [0, 6, 22, 0, 149, 255, 32, 0, 255, 4, 255, 0]
978-
y_ans = np.array(y_ans, dtype=np.uint8).reshape(x_shape)
979-
torch.testing.assert_close(y_np, y_ans)
980-
981-
982955
def test_adjust_hue():
983956
x_shape = [2, 2, 3]
984957
x_data = [0, 5, 13, 54, 135, 226, 37, 8, 234, 90, 255, 1]

0 commit comments

Comments
 (0)