text_plain_output_1.png
import cv2

import glob

mask_directory = '/kaggle/input/mask-images/testMasks'
mask_names = glob.glob('/kaggle/input/mask-images/testMasks/*.tif')
mask_names = sorted(mask_names, key=lambda x: (len(x), x))
print(mask_names[0:6])
masks = [cv2.imread(mask, 0) for mask in mask_names]
print(len(masks))