From 8675208bc9524afc694162e8a295fffe81eb5bad Mon Sep 17 00:00:00 2001 From: Xintao Date: Tue, 7 Sep 2021 21:27:45 +0800 Subject: [PATCH] update: format and standard --- scripts/extract_subimages.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/extract_subimages.py b/scripts/extract_subimages.py index 9630f95..0b4d264 100644 --- a/scripts/extract_subimages.py +++ b/scripts/extract_subimages.py @@ -106,13 +106,7 @@ def worker(path, opt): img = cv2.imread(path, cv2.IMREAD_UNCHANGED) - if img.ndim == 2: - h, w = img.shape - elif img.ndim == 3: - h, w, c = img.shape - else: - raise ValueError(f'Image ndim should be 2 or 3, but got {img.ndim}') - + h, w = img.shape[0:2] h_space = np.arange(0, h - crop_size + 1, step) if h - (h_space[-1] + crop_size) > thresh_size: h_space = np.append(h_space, h - crop_size)