Skip to content

Commit

Permalink
Fix Bboxes numpy.reshape (ultralytics#17301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laughing-q authored Nov 1, 2024
1 parent 3a4b65c commit 591fdbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ultralytics/utils/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def __getitem__(self, index) -> "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)
Expand Down

0 comments on commit 591fdbd

Please sign in to comment.