Skip to content

Commit 5f6eee9

Browse files
authored
Merge branch 'main' into fix_readme_create_project
2 parents 0cde72e + 4e4d79f commit 5f6eee9

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
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.11"
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: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _get_processor_function(model_type: str) -> Callable:
2424
"yolov10",
2525
"yolov11",
2626
"yolov12",
27+
"yolo26",
2728
"yolonas",
2829
"paligemma",
2930
"paligemma2",
@@ -132,6 +133,17 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
132133

133134
print_warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.3.63")], ask_to_continue=True)
134135

136+
elif "yolo26" in model_type:
137+
try:
138+
import torch
139+
import ultralytics
140+
141+
except ImportError:
142+
raise RuntimeError(
143+
"The ultralytics python package is required to deploy yolo26"
144+
" models. Please install it with `pip install ultralytics`"
145+
)
146+
135147
model = torch.load(os.path.join(model_path, filename), weights_only=False)
136148

137149
model_instance = model["model"] if "model" in model and model["model"] is not None else model["ema"]
@@ -145,13 +157,20 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
145157
class_names.sort(key=lambda x: x[0])
146158
class_names = [x[1] for x in class_names]
147159

148-
if "yolov8" in model_type or "yolov10" in model_type or "yolov11" in model_type or "yolov12" in model_type:
160+
if (
161+
"yolov8" in model_type
162+
or "yolov10" in model_type
163+
or "yolov11" in model_type
164+
or "yolov12" in model_type
165+
or "yolo26" in model_type
166+
):
149167
# try except for backwards compatibility with older versions of ultralytics
150168
if (
151169
"-cls" in model_type
152170
or model_type.startswith("yolov10")
153171
or model_type.startswith("yolov11")
154172
or model_type.startswith("yolov12")
173+
or model_type.startswith("yolo26")
155174
):
156175
nc = model_instance.yaml["nc"]
157176
args = model["train_args"]
@@ -227,12 +246,21 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:
227246

228247
def _process_rfdetr(model_type: str, model_path: str, filename: str) -> str:
229248
_supported_types = [
249+
# Detection models
230250
"rfdetr-base",
231-
"rfdetr-large",
232251
"rfdetr-nano",
233252
"rfdetr-small",
234253
"rfdetr-medium",
235-
"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",
236264
]
237265
if model_type not in _supported_types:
238266
raise ValueError(f"Model type {model_type} not supported. Supported types are {_supported_types}")

0 commit comments

Comments
 (0)