ultralytics 8.3.42 update AutoBackend names placeholder (#17970)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
21162bd870
commit
950d9f73fc
2 changed files with 2 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
__version__ = "8.3.40"
|
__version__ = "8.3.42"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
# print(type(x), len(x)) if isinstance(x, (list, tuple)) else print(type(x), x.shape) # debug shapes
|
||||||
if isinstance(y, (list, tuple)):
|
if isinstance(y, (list, tuple)):
|
||||||
if len(self.names) == 999 and (self.task == "segment" or len(y) == 2): # segments and names not defined
|
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[0].shape[1] - y[1].shape[1] - 4 # y = (1, 32, 160, 160), (1, 116, 8400)
|
||||||
nc = y[ib].shape[1] - y[ip].shape[3] - 4 # y = (1, 160, 160, 32), (1, 116, 8400)
|
|
||||||
self.names = {i: f"class{i}" for i in range(nc)}
|
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]
|
return self.from_numpy(y[0]) if len(y) == 1 else [self.from_numpy(x) for x in y]
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue