Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roboflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from roboflow.models import CLIPModel, GazeModel # noqa: F401
from roboflow.util.general import write_line

__version__ = "1.2.11"
__version__ = "1.2.12"


def check_key(api_key, model, notebook, num_retries=0):
Expand Down
21 changes: 20 additions & 1 deletion roboflow/util/model_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def _get_processor_function(model_type: str) -> Callable:
"yolov10",
"yolov11",
"yolov12",
"yolo26",
"yolonas",
"paligemma",
"paligemma2",
Expand Down Expand Up @@ -132,6 +133,17 @@ def _process_yolo(model_type: str, model_path: str, filename: str) -> str:

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

elif "yolo26" in model_type:
try:
import torch
import ultralytics

except ImportError:
raise RuntimeError(
"The ultralytics python package is required to deploy yolo26"
" models. Please install it with `pip install ultralytics`"
)

model = torch.load(os.path.join(model_path, filename), weights_only=False)

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

if "yolov8" in model_type or "yolov10" in model_type or "yolov11" in model_type or "yolov12" in model_type:
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
):
# try except for backwards compatibility with older versions of ultralytics
if (
"-cls" in model_type
or model_type.startswith("yolov10")
or model_type.startswith("yolov11")
or model_type.startswith("yolov12")
or model_type.startswith("yolo26")
):
nc = model_instance.yaml["nc"]
args = model["train_args"]
Expand Down
Loading