Skip to content

Commit c3ab4d0

Browse files
committed
init
1 parent 1dd0500 commit c3ab4d0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

roboflow/util/model_processor.py

Lines changed: 14 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,14 @@ 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 "yolov8" in model_type or "yolov10" in model_type or "yolov11" in model_type or "yolov12" in model_type or "yolo26" in model_type:
149161
# try except for backwards compatibility with older versions of ultralytics
150162
if (
151163
"-cls" in model_type
152164
or model_type.startswith("yolov10")
153165
or model_type.startswith("yolov11")
154166
or model_type.startswith("yolov12")
167+
or model_type.startswith("yolo26")
155168
):
156169
nc = model_instance.yaml["nc"]
157170
args = model["train_args"]

roboflow/util/versions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def _wrapper(*args, **kwargs):
9494
def normalize_yolo_model_type(model_type: str) -> str:
9595
model_type = model_type.replace("yolo11", "yolov11")
9696
model_type = model_type.replace("yolo12", "yolov12")
97+
# yolo26 doesn't use "v" prefix (it's not "yolov26")
9798
return model_type
9899

99100

0 commit comments

Comments
 (0)