Skip to content
Snippets Groups Projects
Commit 8fa0aeab authored by Lukasz Tomasz Bienias's avatar Lukasz Tomasz Bienias
Browse files

Figure 5 added

parent 91340ded
No related branches found
No related tags found
No related merge requests found
figure_5.png

169 KiB

import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
base_dir = os.path.abspath('')
# printing individually #3C279E
colors = ['#440053', 'orange', 'yellow', 'black']
bounds = [0,49,99,149,199]
cmap = mpl.colors.ListedColormap(colors)
norm = mpl.colors.BoundaryNorm(bounds, cmap.N)
# sample_c = mpimg.imread("/work1/s162377/Lua/mask/mask/train_1.png")
# sample_original = mpimg.imread("/work1/s162377/datasets/glands/train/train_1_anno.bmp")
# sample_truth = mpimg.imread("/dtu-compute/s162377/fcn_sa_fcn_article_peripherals/result/New_Contour/New_Contour_Article_SA_FCN_batch2_epoch2000_lr0.0005_t20190301-182248_original/contour/ground_truth/testB_7_truth.bmp")
# sample_predicted = mpimg.imread("/dtu-compute/s162377/fcn_sa_fcn_article_peripherals/result/New_Contour/New_Contour_Article_SA_FCN_batch2_epoch2000_lr0.0005_t20190301-182248_original/contour/predicted/testB_7_predicted.bmp")
# sample_truth = mpimg.imread("/work1/s162377/datasets/glands/contour_lukasz_thicker/val/testA_7_anno.bmp")
# sample_predicted = mpimg.imread("/dtu-compute/s162377/fcn_sa_fcn_article_peripherals/result/New_Contour/New_Contour_Article_SA_FCN_batch2_epoch2000_lr0.0005_t20190301-182248_original/contour/predicted/testA_7_predicted.bmp")
#------------------ thicker ground truth
# old, but this
# sample_truth = mpimg.imread("/dtu-compute/s162377/fcn_sa_fcn_article_peripherals/result/Single_Multi/Thick/ContourNEWNEWNEW_Contour_Article_SA_FCN_batch2_epoch2000_lr5e-05_t20190302-231009_original/ground_truth/testB_10_truth.bmp")
# sample_predicted = mpimg.imread("/dtu-compute/s162377/fcn_sa_fcn_article_peripherals/result/Single_Multi/Thick/ContourNEWNEWNEW_Contour_Article_SA_FCN_batch2_epoch2000_lr5e-05_t20190302-231009_original/predicted/testB_10_predicted.bmp")
sample_truth = mpimg.imread(base_dir + '/sa_fcn/network_predictions/1/ground_truth/contour/testB_7_truth.bmp')
sample_predicted = mpimg.imread(base_dir + "/sa_fcn/network_predictions/1/predicted/contour/testB_7_predicted.bmp")
#sample_truth = mpimg.imread("testB_7_truth.bmp")
#sample_predicted = mpimg.imread("testB_7_predicted.bmp")
sample_binary = np.array(sample_predicted)
sample_binary[sample_binary < 127] = 0
sample_binary[sample_binary > 126] = 1
sample_truth = np.array(sample_truth)
sample_truth[sample_truth == 1] = 100
sample_binary[sample_binary == 1] = 50
plt.figure(figsize=(20,15))
plt.subplot(2, 2, 1)
plt.title('PREDICTED FLOAT')
plt.axis('off')
plt.imshow(sample_predicted)
plt.subplot(2, 2, 2)
plt.title('PREDICTED BINARY')
plt.axis('off')
plt.imshow(sample_binary)
plt.subplot(2, 2, 3)
plt.title('GROUND TRUTH')
plt.axis('off')
plt.imshow(sample_truth)
combined = sample_truth + sample_binary
plt.subplot(2, 2, 4)
plt.title('COMBINED')
plt.axis('off')
plt.imshow(combined, interpolation='none', cmap=cmap, norm=norm)
plt.savefig('figure_5.png')
sa_fcn/network_predictions/1/ground_truth/contour/testB_7_truth.bmp

385 KiB

No preview for this file type
No preview for this file type
No preview for this file type
...@@ -21,7 +21,7 @@ import time ...@@ -21,7 +21,7 @@ import time
n_class = 2 n_class = 2
batch_size = 2 batch_size = 2
epochs = 2 # should be 2000 epochs = 20 # should be 2000
lr = 0.0005 lr = 0.0005
#momentum = 0.9 # for RMSprop #momentum = 0.9 # for RMSprop
#w_decay = 0 #w_decay = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment