From edcfa1769f9b256c855d9ee1f537105dd302e24e Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 23 Mar 2021 14:10:47 +0100 Subject: [PATCH] Update Detections() times=None (#2570) Fix for results.tolist() method breaking after YOLOv5 Hub profiling PRshttps://github.com/ultralytics/yolov5/pull/2460 https://github.com/ultralytics/yolov5/pull/2459 and (cherry picked from commit 1c132a1f9426d91c18ec7eff6ab95a727344c690) --- models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/common.py b/models/common.py index 83cc8b5ce27b..721171393e04 100644 --- a/models/common.py +++ b/models/common.py @@ -235,7 +235,7 @@ def forward(self, imgs, size=640, augment=False, profile=False): class Detections: # detections class for YOLOv5 inference results - def __init__(self, imgs, pred, files, times, names=None, shape=None): + def __init__(self, imgs, pred, files, times=None, names=None, shape=None): super(Detections, self).__init__() d = pred[0].device # device gn = [torch.tensor([*[im.shape[i] for i in [1, 0, 1, 0]], 1., 1.], device=d) for im in imgs] # normalizations