From 533a0d3576b0b17278a7b1cb98699c016221bca5 Mon Sep 17 00:00:00 2001 From: tudoulei <34886368+tudoulei@users.noreply.github.com> Date: Sun, 30 May 2021 03:12:01 +0800 Subject: [PATCH] `cv2.imread(img, -1)` for IMREAD_UNCHANGED (#3379) * Update datasets.py * comment Co-authored-by: Glenn Jocher (cherry picked from commit 21a9607e00f1365b21d8c4bd81bdbf5fc0efea24) --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index b6e43b94cfe9..f617c02d1503 100644 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -181,7 +181,7 @@ def __next__(self): else: # Read image self.count += 1 - img0 = cv2.imread(path) # BGR + img0 = cv2.imread(path, -1) # BGR (-1 is IMREAD_UNCHANGED) assert img0 is not None, 'Image Not Found ' + path print(f'image {self.count}/{self.nf} {path}: ', end='')