From fc9a790dea6c9829d7fbd5f37d115934ba58c1ab Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:41:30 +0200 Subject: [PATCH] Fix test with exif_transpose image --- tests/utils/test_image_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/utils/test_image_utils.py b/tests/utils/test_image_utils.py index ee45300a7e5279..49c88afebcbf71 100644 --- a/tests/utils/test_image_utils.py +++ b/tests/utils/test_image_utils.py @@ -21,6 +21,7 @@ import numpy as np import pytest from huggingface_hub.file_download import http_get +from packaging import version from requests import ConnectTimeout, ReadTimeout from tests.pipelines.test_pipelines_document_question_answering import INVOICE_URL @@ -586,7 +587,7 @@ def test_load_img_exif_transpose(self): self.assertEqual( img_arr_without_exif_transpose.shape, - (333, 500, 3), + (500, 333, 3) if version.parse(datasets.__version__) > version.parse("2.18.0") else (333, 500, 3), ) img_with_exif_transpose = load_image(dataset[3]["image"])