From 6baa3bdde6b38285af1af2677e0fd8d0443008dd Mon Sep 17 00:00:00 2001 From: Mert Can Demir Date: Mon, 20 Nov 2023 04:22:08 +0300 Subject: [PATCH] `ultralytics 8.0.213` NVIDIA Triton gRPC fix (#6443) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/engine/model.py | 2 +- ultralytics/nn/autobackend.py | 2 +- ultralytics/utils/checks.py | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index f02bcdf4..26699e6b 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.212' +__version__ = '8.0.213' from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models.fastsam import FastSAM diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index fa8dc3a1..15427628 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -102,7 +102,7 @@ class Model(nn.Module): """Is model a Triton Server URL string, i.e. :////""" from urllib.parse import urlsplit url = urlsplit(model) - return url.netloc and url.path and url.scheme in {'http', 'grfc'} + return url.netloc and url.path and url.scheme in {'http', 'grpc'} @staticmethod def is_hub_model(model): diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 10ac2c4e..596d9bda 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -509,6 +509,6 @@ class AutoBackend(nn.Module): else: from urllib.parse import urlsplit url = urlsplit(p) - triton = url.netloc and url.path and url.scheme in {'http', 'grfc'} + triton = url.netloc and url.path and url.scheme in {'http', 'grpc'} return types + [triton] diff --git a/ultralytics/utils/checks.py b/ultralytics/utils/checks.py index 8cf14ccb..9aaf5f4f 100644 --- a/ultralytics/utils/checks.py +++ b/ultralytics/utils/checks.py @@ -439,7 +439,8 @@ def check_file(file, suffix='', download=True, hard=True): check_suffix(file, suffix) # optional file = str(file).strip() # convert to string and strip spaces file = check_yolov5u_filename(file) # yolov5n -> yolov5nu - if not file or ('://' not in file and Path(file).exists()): # exists ('://' check required in Windows Python<3.10) + if (not file or ('://' not in file and Path(file).exists()) or # '://' check required in Windows Python<3.10 + file.lower().startswith('grpc://')): # file exists or gRPC Triton images return file elif download and file.lower().startswith(('https://', 'http://', 'rtsp://', 'rtmp://', 'tcp://')): # download url = file # warning: Pathlib turns :// -> :/