text_plain_output_2.png text_plain_output_1.png
from PIL import Image

import matplotlib.pyplot as plt

import os

BATCH_SIZE = 16
IMAGE_SIZE = (256, 256)
IN_CHANNELS = 3
LEARNING_RATE = 0.0001
IMAGES_DIR = '/kaggle/input/danish-golf-courses-orthophotos/1. orthophotos/'
SEGMASKS_DIR = '/kaggle/input/danish-golf-courses-orthophotos/2. segmentation masks/'
LABELMASKS_DIR = '/kaggle/input/danish-golf-courses-orthophotos/3. class masks/'

orthophoto_list = os.listdir(IMAGES_DIR)
print('There are ', len(orthophoto_list), ' orthophotos in this dataset!')
idx = 5
golf_image = Image.open(os.path.join(IMAGES_DIR, orthophoto_list[idx]))
golf_segmask = Image.open(os.path.join(SEGMASKS_DIR, orthophoto_list[idx].replace('.jpg', '.png')))
fig, axes = plt.subplots(1, 2)
axes[0].set_title('Orthophoto')
axes[1].set_title('Segmentation Mask')
axes[0].imshow(golf_image)
axes[1].imshow(golf_segmask)