text_plain_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import os

import os

train_images_dir = 'train_images'
train_maps_dir = 'train_labels'
val_images_dir = 'valid_images'
val_maps_dir = 'valid_labels'
test_images_dir = 'test_images'
test_maps_dir = 'test_labels'
train_images = np.array(os.listdir(train_images_dir), dtype=object)
train_maps = np.array(os.listdir(train_maps_dir), dtype=object)
val_images = np.array(os.listdir(val_images_dir), dtype=object)
val_maps = np.array(os.listdir(val_maps_dir), dtype=object)

train_yarn_dataset = Dataset(train_images_dir, train_maps_dir)
valid_yarn_dataset = Dataset(val_images_dir, val_maps_dir)
sample_img, sample_map = train_yarn_dataset[8]
fig, ax = plt.subplots(1, 2, figsize=(15, 10))
ax[0].imshow(sample_img)
ax[1].imshow(sample_map * 255)