Skip to content

Commit

Permalink
Detections().tolist() explicit argument fix (#5907)
Browse files Browse the repository at this point in the history
debugged for missigned Detections attributes
  • Loading branch information
lizeng614 authored Dec 7, 2021
1 parent 1075488 commit fa05f8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def pandas(self):

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
Expand Down

0 comments on commit fa05f8c

Please sign in to comment.