@@ -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" ]
0 commit comments