@KFrank,
Hi, KFrank!
My dataset is Fundus image. I try to use U-net model to perform medical image segmentation
        for step, data in enumerate(trainloader):
            imgs, labels, _, _ = data
            model.train()
            outputs = model(imgs)   #   B * C * H *W  outputs [4,2,224,224]
            output_c1 = outputs[:,1,:,:]  # output_c1 [4,224,224]
            labels_show =labels.cpu().detach().numpy().astype(np.uint8)
            img_show = imgs.cpu().detach().numpy().astype(np.uint8)
            plt.figure()
            plt.subplot(4, 2, 1)
            plt.imshow(labels_show[0,:,:]),plt.axis('off')
            plt.subplot(4, 2, 2)
            plt.imshow(img_show[0,1,:,:]),plt.axis('off')
            plt.subplot(4, 2, 3)
            plt.imshow(labels_show[1,:,:]),plt.axis('off')
            plt.subplot(4, 2, 4)
            plt.imshow(img_show[1,1,:,:]),plt.axis('off')
            plt.subplot(4, 2, 5)
            plt.imshow(labels_show[2,:,:]),plt.axis('off')
            plt.subplot(4, 2, 6)
            plt.imshow(img_show[2,1,:,:]),plt.axis('off')
            plt.subplot(4, 2, 7)
            plt.imshow(labels_show[3,:,:]),plt.axis('off')
            plt.subplot(4, 2, 8)
            plt.imshow(img_show[3,1,:,:]),plt.axis('off')
            plt.pause(0.5) 


image639×570 53.8 KB

Left column isFundus vessels pictures and also is  labels, right colum is  Fundus image and also is  imgs .
labels information is here

labels[0,17,128]  tell us The first picture in a batch that Pixel values in row 17 and column 128
and imgs information is here

outputs information is here

output_c1  information is here