From ed55cbbd22295864e0d159ef3d7321dcbf4b7632 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 30 Jun 2025 10:20:23 +0200 Subject: [PATCH 1/6] Add pillow-avif-plugin for AVIF support --- requirements.txt | 3 ++- roboflow/__init__.py | 2 +- roboflow/util/image_utils.py | 4 +++- tests/test_project.py | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index d0736cd6..027054fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,8 @@ numpy>=1.18.5 opencv-python-headless==4.10.0.84 Pillow>=7.1.2 # https://github.com/roboflow/roboflow-python/issues/390 -pillow-heif<1 +pillow-heif<2 +pillow-avif-plugin python-dateutil python-dotenv requests diff --git a/roboflow/__init__.py b/roboflow/__init__.py index 00fae2b2..85524714 100644 --- a/roboflow/__init__.py +++ b/roboflow/__init__.py @@ -15,7 +15,7 @@ from roboflow.models import CLIPModel, GazeModel # noqa: F401 from roboflow.util.general import write_line -__version__ = "1.1.67" +__version__ = "1.1.68" def check_key(api_key, model, notebook, num_retries=0): diff --git a/roboflow/util/image_utils.py b/roboflow/util/image_utils.py index c9ca6b2a..5166c0a6 100644 --- a/roboflow/util/image_utils.py +++ b/roboflow/util/image_utils.py @@ -4,6 +4,8 @@ import os import urllib +import pillow_avif # type: ignore[import-untyped] + # Third-party imports import pillow_heif # type: ignore[import-untyped] import requests @@ -11,7 +13,7 @@ from PIL import Image pillow_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC -pillow_heif.register_avif_opener(thumbnails=False) # Register for AVIF +pillow_avif.register_avif_opener() # Register for AVIF def check_image_path(image_path): diff --git a/tests/test_project.py b/tests/test_project.py index 384e1d3a..96ff4ab9 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -85,6 +85,7 @@ def test_check_valid_image_with_accepted_formats(self): "woodland-rabbit.png", "file_example_TIFF_1MB.tiff", "sky-rabbit.heic", + "whatsnew.avif", ] for image in images_to_test: From bfa0a7a304f3b16f7444fe94a7a2acfb6b3a142e Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 30 Jun 2025 10:21:55 +0200 Subject: [PATCH 2/6] Update image_utils.py --- roboflow/util/image_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roboflow/util/image_utils.py b/roboflow/util/image_utils.py index 5166c0a6..074e3a5f 100644 --- a/roboflow/util/image_utils.py +++ b/roboflow/util/image_utils.py @@ -4,16 +4,14 @@ import os import urllib -import pillow_avif # type: ignore[import-untyped] - # Third-party imports +import pillow_avif # type: ignore[import-untyped] import pillow_heif # type: ignore[import-untyped] import requests import yaml from PIL import Image pillow_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC -pillow_avif.register_avif_opener() # Register for AVIF def check_image_path(image_path): From e7b7a6ba40a5d27d5e433a99e08a082aef273e4b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 08:22:03 +0000 Subject: [PATCH 3/6] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roboflow/util/image_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/roboflow/util/image_utils.py b/roboflow/util/image_utils.py index 074e3a5f..a52d6419 100644 --- a/roboflow/util/image_utils.py +++ b/roboflow/util/image_utils.py @@ -5,7 +5,6 @@ import urllib # Third-party imports -import pillow_avif # type: ignore[import-untyped] import pillow_heif # type: ignore[import-untyped] import requests import yaml From 6e6e67e57cd277e0ffe7c52db34cea04e506a4ab Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 30 Jun 2025 10:57:12 +0200 Subject: [PATCH 4/6] . --- roboflow/util/image_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roboflow/util/image_utils.py b/roboflow/util/image_utils.py index a52d6419..71a32824 100644 --- a/roboflow/util/image_utils.py +++ b/roboflow/util/image_utils.py @@ -5,12 +5,14 @@ import urllib # Third-party imports +import pillow_avif # type: ignore[import-untyped] import pillow_heif # type: ignore[import-untyped] import requests import yaml from PIL import Image pillow_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC +pillow_avif = pillow_avif # Reference pillow_avif to not remove import by accident def check_image_path(image_path): From 34469fe33832b201c7360651097f8afa1244e849 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 30 Jun 2025 11:08:07 +0200 Subject: [PATCH 5/6] remove python 3.8 --- .github/workflows/test.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9481351..6173fc4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "windows-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} env: PYTHONUTF8: 1 diff --git a/requirements.txt b/requirements.txt index 027054fd..0ca7bcb5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ opencv-python-headless==4.10.0.84 Pillow>=7.1.2 # https://github.com/roboflow/roboflow-python/issues/390 pillow-heif<2 -pillow-avif-plugin +pillow-avif-plugin<2 python-dateutil python-dotenv requests From 4532802cf492288848a61fbe5de72a155f94a144 Mon Sep 17 00:00:00 2001 From: Iuri de Silvio Date: Mon, 30 Jun 2025 11:08:19 +0200 Subject: [PATCH 6/6] . --- roboflow/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roboflow/__init__.py b/roboflow/__init__.py index 85524714..c2d52491 100644 --- a/roboflow/__init__.py +++ b/roboflow/__init__.py @@ -15,7 +15,7 @@ from roboflow.models import CLIPModel, GazeModel # noqa: F401 from roboflow.util.general import write_line -__version__ = "1.1.68" +__version__ = "1.2.0" def check_key(api_key, model, notebook, num_retries=0):