From 950d9f73fc3e12c87e45f4f792281ee8e3cfc75f Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:46:40 +0800 Subject: [PATCH] `ultralytics 8.3.42` update AutoBackend `names` placeholder (#17970) Signed-off-by: Glenn Jocher Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/nn/autobackend.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 601d1bb3..712d2a0f 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.3.40" +__version__ = "8.3.42" import os diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 60b9f638..17504b82 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -700,8 +700,7 @@ class AutoBackend(nn.Module): # print(type(x), len(x)) if isinstance(x, (list, tuple)) else print(type(x), x.shape) # debug shapes if isinstance(y, (list, tuple)): if len(self.names) == 999 and (self.task == "segment" or len(y) == 2): # segments and names not defined - ip, ib = (0, 1) if len(y[0].shape) == 4 else (1, 0) # index of protos, boxes - nc = y[ib].shape[1] - y[ip].shape[3] - 4 # y = (1, 160, 160, 32), (1, 116, 8400) + nc = y[0].shape[1] - y[1].shape[1] - 4 # y = (1, 32, 160, 160), (1, 116, 8400) self.names = {i: f"class{i}" for i in range(nc)} return self.from_numpy(y[0]) if len(y) == 1 else [self.from_numpy(x) for x in y] else: