From 65bb0e98e988987ac4be9db4fa7997d3263aabc6 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Thu, 24 Apr 2025 01:36:40 +0800 Subject: [PATCH] `ultralytics 8.3.115` TIFF image RGB training and prediction support (#20301) Signed-off-by: Glenn Jocher Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/utils/patches.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 03ed9568..836031f5 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license -__version__ = "8.3.114" +__version__ = "8.3.115" import os diff --git a/ultralytics/utils/patches.py b/ultralytics/utils/patches.py index 78ab8ab3..a7ca52ca 100644 --- a/ultralytics/utils/patches.py +++ b/ultralytics/utils/patches.py @@ -31,7 +31,8 @@ def imread(filename: str, flags: int = cv2.IMREAD_COLOR): if filename.endswith((".tiff", ".tif")): success, frames = cv2.imdecodemulti(file_bytes, cv2.IMREAD_UNCHANGED) if success: - return np.stack(frames, axis=2) # or np.asarray(frames).transpose(1,2,0) + # handle RGB images in tif/tiff format + return frames[0] if len(frames) == 1 and frames[0].ndim == 3 else np.stack(frames, axis=2) return None else: return cv2.imdecode(file_bytes, flags)