ultralytics 8.2.46 fix OBB Results xyxy attribute (#14020)
This commit is contained in:
parent
69cfc8aa22
commit
5f7d76e2eb
4 changed files with 11 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
__version__ = "8.2.45"
|
||||
__version__ = "8.2.46"
|
||||
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -743,9 +743,10 @@ class OBB(BaseTensor):
|
|||
|
||||
Accepts both torch and numpy boxes.
|
||||
"""
|
||||
x1 = self.xyxyxyxy[..., 0].min(1).values
|
||||
x2 = self.xyxyxyxy[..., 0].max(1).values
|
||||
y1 = self.xyxyxyxy[..., 1].min(1).values
|
||||
y2 = self.xyxyxyxy[..., 1].max(1).values
|
||||
xyxy = [x1, y1, x2, y2]
|
||||
return np.stack(xyxy, axis=-1) if isinstance(self.data, np.ndarray) else torch.stack(xyxy, dim=-1)
|
||||
x = self.xyxyxyxy[..., 0]
|
||||
y = self.xyxyxyxy[..., 1]
|
||||
return (
|
||||
torch.stack([x.amin(1), y.amin(1), x.amax(1), y.amax(1)], -1)
|
||||
if isinstance(x, torch.Tensor)
|
||||
else np.stack([x.min(1), y.min(1), x.max(1), y.max(1)], -1)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue