Fix Bboxes numpy.reshape (#17301)

This commit is contained in:
Laughing 2024-11-01 21:08:30 +08:00 committed by GitHub
parent 3a4b65c347
commit 591fdbd8b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -176,7 +176,7 @@ class Bboxes:
length as the number of bounding boxes.
"""
if isinstance(index, int):
return Bboxes(self.bboxes[index].view(1, -1))
return Bboxes(self.bboxes[index].reshape(1, -1))
b = self.bboxes[index]
assert b.ndim == 2, f"Indexing on Bboxes with {index} failed to return a matrix!"
return Bboxes(b)