We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 988f324 commit 6f8ce5bCopy full SHA for 6f8ce5b
tests/test_utils.py
@@ -21,7 +21,7 @@ def image_path() -> str:
21
@pytest.fixture()
22
def image_obj(image_path) -> Image:
23
"""return a PIL image"""
24
- return Image.open(image_path).convert("RGB")
+ return Image.open(image_path)
25
26
27
utils/image.py
@@ -48,6 +48,7 @@ def transform_image(
48
transform_level: TransformationLevel = TransformationLevel.ALL,
49
) -> torch.Tensor:
50
"""Transform and normalize a PIL image into a torch tensor ranging values from 0 to 1"""
51
+ img = img.convert("RGB")
52
53
image_tensor = v2.Compose(
54
get_transformations_pipeline(width, height, transform_level)
0 commit comments