Browse Source

update: format and standard

Xintao 3 years ago
parent
commit
8675208bc9
1 changed files with 1 additions and 7 deletions
  1. 1 7
      scripts/extract_subimages.py

+ 1 - 7
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)