Skip to content

Commit 0596010

Browse files
authored
Merge pull request #432 from roboflow/yolo26
Add Yolo26
2 parents 1dd0500 + 9851695 commit 0596010

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

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.12"
1919

2020

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

roboflow/util/model_processor.py

Lines changed: 20 additions & 1 deletion
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"]

0 commit comments

Comments
 (0)