image_output_1.png
from keras.preprocessing import image

from pathlib import Path

import matplotlib.pyplot as plt

img_root_path = Path('../input/chest-xray-masks-and-labels/Lung Segmentation/CXR_png/')
mask_root_path = Path('../input/chest-xray-masks-and-labels/Lung Segmentation/masks')
test_root_path = Path('../input/chest-xray-masks-and-labels/Lung Segmentation/test')
img_paths = sorted(img_root_path.iterdir())
mask_paths = sorted(mask_root_path.iterdir())
test_paths = sorted(test_root_path.iterdir())

images = []
masks = []
test_images = []
image_size = (256, 256)
for img, mask, test_img in zip(img_paths, mask_paths, test_paths):
    images.append(image.load_img(img, target_size=image_size))
    masks.append(image.load_img(mask, target_size=image_size))
    test_images.append(image.load_img(test_img, target_size=image_size))

plt.imshow(masks[0].convert('RGBA'))