Skip to content

Commit 4e4d79f

Browse files
authored
Add large rfdetr sizes and seg models upload (#434)
* new models * fix test? * pi_heif python 3.9 fix * pi_heif python 3.9 fix * version bump
1 parent 0596010 commit 4e4d79f

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ numpy>=1.18.5
77
opencv-python-headless==4.10.0.84
88
Pillow>=7.1.2
99
# https://github.com/roboflow/roboflow-python/issues/390
10-
pi-heif<2
10+
# pi-heif 1.x requires Python 3.10+
11+
pi-heif<2; python_version >= "3.10"
1112
pillow-avif-plugin<2
1213
python-dateutil
1314
python-dotenv

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from roboflow.models import CLIPModel, GazeModel # noqa: F401
1616
from roboflow.util.general import write_line
1717

18-
__version__ = "1.2.12"
18+
__version__ = "1.2.13"
1919

2020

2121
def check_key(api_key, model, notebook, num_retries=0):

roboflow/util/image_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
import urllib
66

77
# Third-party imports
8-
import pi_heif # type: ignore[import-untyped]
98
import pillow_avif # type: ignore[import-untyped]
109
import requests
1110
import yaml
1211
from PIL import Image
1312

14-
pi_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC
13+
# pi-heif requires Python 3.10+
14+
try:
15+
import pi_heif # type: ignore[import-untyped,import-not-found]
16+
17+
pi_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC
18+
except ImportError:
19+
pass
1520
pillow_avif = pillow_avif # Reference pillow_avif to not remove import by accident
1621

1722

roboflow/util/model_processor.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,21 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
246246

247247
def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
248248
_supported_types = [
249+
# Detection models
249250
"rfdetr-base",
250-
"rfdetr-large",
251251
"rfdetr-nano",
252252
"rfdetr-small",
253253
"rfdetr-medium",
254-
"rfdetr-seg-preview",
254+
"rfdetr-large",
255+
"rfdetr-xlarge",
256+
"rfdetr-2xlarge",
257+
# Segmentation models
258+
"rfdetr-seg-nano",
259+
"rfdetr-seg-small",
260+
"rfdetr-seg-medium",
261+
"rfdetr-seg-large",
262+
"rfdetr-seg-xlarge",
263+
"rfdetr-seg-2xlarge",
255264
]
256265
if model_type not in _supported_types:
257266
raise ValueError(f"Model type {model_type} not supported. Supported types are {_supported_types}")

0 commit comments

Comments
 (0)