I am using the below code and I got an image and the corresponding mask
test_img, test_lb, test_mask = next(iter(train_dataloader))

plt.figure()
# testdata
plt.subplot(1, 2, 1)
plt.imshow(test_img[0][0].cpu().detach().numpy()*255)
plt.title('Real Image')

plt.subplot(1, 2, 2)
plt.imshow(test_mask[0][0].cpu().detach().numpy().astype(np.uint8)*255)
plt.title('Mask')
    
plt.savefig('./Image_Mask.jpg')

plt.show()

How can I also check them ?