Detections().tolist() explicit argument fix (#5907)

debugged for missigned Detections attributes
This commit is contained in:
Li Zeng authored and GitHub committed 2021-12-07 16:01:41 +01:00
1 parent 1075488d89
commit fa05f8c977
1 file changed
+1 -1
+1 -1
View File
@@ -608,7 +608,7 @@ class Detections:
def tolist(self):
# return a list of Detections objects, i.e. 'for result in results.tolist():'
x = [Detections([self.imgs[i]], [self.pred[i]], self.names, self.s) for i in range(self.n)]
x = [Detections([self.imgs[i]], [self.pred[i]], names=self.names, shape=self.s) for i in range(self.n)]
for d in x:
for k in ['imgs', 'pred', 'xyxy', 'xyxyn', 'xywh', 'xywhn']:
setattr(d, k, getattr(d, k)[0]) # pop out of list