diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 4014ac4a..1914e08c 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.27" +__version__ = "8.2.28" import os diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index d2727fe2..6ec42fce 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -184,7 +184,7 @@ class AutoBackend(nn.Module): LOGGER.info(f"Loading {w} for ONNX Runtime inference...") check_requirements(("onnx", "onnxruntime-gpu" if cuda else "onnxruntime")) if IS_RASPBERRYPI or IS_JETSON: - # Fix error: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' when exporting to Tensorflow SavedModel on RPi and Jetson + # Fix 'numpy.linalg._umath_linalg' has no attribute '_ilp64' for TF SavedModel on RPi and Jetson check_requirements("numpy==1.23.5") import onnxruntime diff --git a/ultralytics/utils/ops.py b/ultralytics/utils/ops.py index 5acf75ea..6dc6024a 100644 --- a/ultralytics/utils/ops.py +++ b/ultralytics/utils/ops.py @@ -402,7 +402,7 @@ def xyxy2xywh(x): def xywh2xyxy(x): """ Convert bounding box coordinates from (x, y, width, height) format to (x1, y1, x2, y2) format where (x1, y1) is the - top-left corner and (x2, y2) is the bottom-right corner. + top-left corner and (x2, y2) is the bottom-right corner. Note: ops per 2 channels faster than per channel. Args: x (np.ndarray | torch.Tensor): The input bounding box coordinates in (x, y, width, height) format. @@ -412,12 +412,10 @@ def xywh2xyxy(x): """ assert x.shape[-1] == 4, f"input shape last dimension expected 4 but input shape is {x.shape}" y = torch.empty_like(x) if isinstance(x, torch.Tensor) else np.empty_like(x) # faster than clone/copy - dw = x[..., 2] / 2 # half-width - dh = x[..., 3] / 2 # half-height - y[..., 0] = x[..., 0] - dw # top left x - y[..., 1] = x[..., 1] - dh # top left y - y[..., 2] = x[..., 0] + dw # bottom right x - y[..., 3] = x[..., 1] + dh # bottom right y + xy = x[..., :2] # centers + wh = x[..., 2:] / 2 # half width-height + y[..., :2] = xy - wh # top left xy + y[..., 2:] = xy + wh # bottom right xy return y