python - How to load images in the same folder in Pytorch ...
stackoverflow.com › questions › 54898655Feb 27, 2019 · If you want to load all the images from the two folders then you can try cv2. import cv2 img = [] for i in range(n): # n = number of images in img folder img_path = f'~data\img\{i}.png' # replace ~ with full path img.append(cv2.imread(img_path)) for i in range(n): # n = number of images in mask folder img_path = f'~data\mask\lable_{i}.png' # replace ~ with full path img.append(cv2.imread(img ...