diff --git a/requirements.txt b/requirements.txt index 71092638..81d180c2 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 -pi-heif<2 +# pi-heif 1.x requires Python 3.10+ +pi-heif<2; python_version >= "3.10" pillow-avif-plugin<2 python-dateutil python-dotenv diff --git a/roboflow/__init__.py b/roboflow/__init__.py index 2bdaec47..6954ce23 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.2.12" +__version__ = "1.2.13" 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 2f3b2c1f..6e159df9 100644 --- a/roboflow/util/image_utils.py +++ b/roboflow/util/image_utils.py @@ -5,13 +5,18 @@ import urllib # Third-party imports -import pi_heif # type: ignore[import-untyped] import pillow_avif # type: ignore[import-untyped] import requests import yaml from PIL import Image -pi_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC +# pi-heif requires Python 3.10+ +try: + import pi_heif # type: ignore[import-untyped,import-not-found] + + pi_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC +except ImportError: + pass pillow_avif = pillow_avif # Reference pillow_avif to not remove import by accident diff --git a/roboflow/util/model_processor.py b/roboflow/util/model_processor.py index 6216005c..cd0fe2db 100644 --- a/roboflow/util/model_processor.py +++ b/roboflow/util/model_processor.py @@ -246,12 +246,21 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str: def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str: _supported_types = [ + # Detection models "rfdetr-base", - "rfdetr-large", "rfdetr-nano", "rfdetr-small", "rfdetr-medium", - "rfdetr-seg-preview", + "rfdetr-large", + "rfdetr-xlarge", + "rfdetr-2xlarge", + # Segmentation models + "rfdetr-seg-nano", + "rfdetr-seg-small", + "rfdetr-seg-medium", + "rfdetr-seg-large", + "rfdetr-seg-xlarge", + "rfdetr-seg-2xlarge", ] if model_type not in _supported_types: raise ValueError(f"Model type {model_type} not supported. Supported types are {_supported_types}")