Unverified 提交 fa05f8c9 authored 作者: Li Zeng's avatar Li Zeng 提交者: GitHub

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

debugged for missigned Detections attributes
上级 1075488d
...@@ -608,7 +608,7 @@ class Detections: ...@@ -608,7 +608,7 @@ class Detections:
def tolist(self): def tolist(self):
# return a list of Detections objects, i.e. 'for result in results.tolist():' # 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 d in x:
for k in ['imgs', 'pred', 'xyxy', 'xyxyn', 'xywh', 'xywhn']: for k in ['imgs', 'pred', 'xyxy', 'xyxyn', 'xywh', 'xywhn']:
setattr(d, k, getattr(d, k)[0]) # pop out of list setattr(d, k, getattr(d, k)[0]) # pop out of list
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论