From 87233ea17c3286bfdd13b0616d878971ca43cef0 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 14 Nov 2023 00:39:18 +0100 Subject: [PATCH] Fix SAM CLI stem usage (#6257) --- ultralytics/cfg/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ultralytics/cfg/__init__.py b/ultralytics/cfg/__init__.py index 226d4894..17414423 100644 --- a/ultralytics/cfg/__init__.py +++ b/ultralytics/cfg/__init__.py @@ -405,13 +405,14 @@ def entrypoint(debug=''): model = 'yolov8n.pt' LOGGER.warning(f"WARNING ⚠️ 'model' is missing. Using default 'model={model}'.") overrides['model'] = model - if 'rtdetr' in model.lower(): # guess architecture + stem = Path(model).stem.lower() + if 'rtdetr' in stem: # guess architecture from ultralytics import RTDETR model = RTDETR(model) # no task argument - elif 'fastsam' in model.lower(): + elif 'fastsam' in stem: from ultralytics import FastSAM model = FastSAM(model) - elif 'sam' in model.lower(): + elif 'sam' in stem: from ultralytics import SAM model = SAM(model) else: