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

Figures corrections

parent 07cf5d0b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy.io import loadmat
import os
import numpy as np
base_dir = os.path.abspath('')
# ---------------- FIRST ROW ------------------------
......@@ -60,6 +61,7 @@ plt.imshow(original_small_img)
plt.subplot(4, 4, 8)
#original_sa_fcn_img = loadmat(r'C:\Users\lutobi\Documents\testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
original_sa_fcn_img = loadmat(base_dir + '/sa_fcn/post_processing/original/1/predicted_pp/testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
original_sa_fcn_img = np.square(original_sa_fcn_img)
# /dtu-compute/s162377/mlsp2019_software_package/sa_fcn/post_processing/original/1/predicted_pp
plt.title("FINAL PREDICTION")
plt.axis('off')
......@@ -94,6 +96,7 @@ plt.imshow(dcan_fill_img)
plt.subplot(4, 4, 12)
#dcan_img = loadmat(r'C:\Users\lutobi\Documents\testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
dcan_img = loadmat(base_dir + '/sa_fcn/post_processing/dcan/1/predicted_pp/testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
dcan_img = np.square(dcan_img)
# /dtu-compute/s162377/mlsp2019_software_package/sa_fcn/post_processing/dcan/1/predicted_pp
plt.title("FINAL PREDICTION")
plt.axis('off')
......@@ -129,10 +132,10 @@ plt.imshow(our_dilated_img)
plt.subplot(4, 4, 16)
#our_img = loadmat(r'C:\Users\lutobi\Documents\testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
our_img = loadmat(base_dir + '/sa_fcn/post_processing/our/1/predicted_pp/testA_44_post.mat',variable_names='testI',appendmat=True).get('testI')
our_img = np.square(our_img)
# /dtu-compute/s162377/mlsp2019_software_package/sa_fcn/post_processing/our/1/predicted_pp
plt.title("FINAL PREDICTION")
plt.axis('off')
plt.imshow(our_img)
plt.savefig('figure_4.png')
plt.savefig('figure_4.pdf')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy.io import loadmat
import numpy as np
import os
......@@ -37,6 +38,7 @@ plt.imshow(mask_binary_img)
plt.subplot(2, 5, 4)
#mask_post_img = loadmat(r'C:\Users\lutobi\Documents\figures_mlsp_reporducibility_package\testA_56_post_mask.mat',variable_names='testI',appendmat=True).get('testI')
mask_post_img = loadmat(base_dir + '/mask_rcnn/post_processing/1/predicted_pp/testA_56_post.mat',variable_names='testI',appendmat=True).get('testI')
mask_post_img = np.square(mask_post_img)
# /dtu-compute/s162377/mlsp2019_software_package/mask_rcnn/post_processing/1/predicted_pp
plt.title("AFTER POST-PROCESSING")
plt.axis('off')
......@@ -77,6 +79,8 @@ plt.imshow(safcn_binary_img)
plt.subplot(2, 5, 9)
#safcn_post_img = loadmat(r'C:\Users\lutobi\Documents\figures_mlsp_reporducibility_package\testA_56_post_safcn.mat',variable_names='testI',appendmat=True).get('testI')
safcn_post_img = loadmat(base_dir + '/sa_fcn/post_processing/our/1/predicted_pp/testA_56_post.mat',variable_names='testI',appendmat=True).get('testI')
safcn_post_img = np.square(safcn_post_img)
# /dtu-compute/s162377/mlsp2019_software_package/sa_fcn/post_processing/our/1/predicted_pp
plt.axis('off')
plt.imshow(safcn_post_img)
......
......@@ -6,10 +6,10 @@ echo Welcome to Mask RCNN!
echo ============================================================================================== &&
echo Lets start with some training! &&
cd samples/glands/ &&
for i in {1..5}
do
python3 -W ignore glands.py train --dataset=/dtu-compute/s162377/mask_rcnn_git/samples/glands/glands/ --subset=train --weights=coco
done || exit 1
#for i in {1..5}
#do
# python3 -W ignore glands.py train --dataset=/dtu-compute/s162377/mask_rcnn_git/samples/glands/glands/ --subset=train --weights=coco
#done || exit 1
echo Successfully finished training! &&
echo ============================================================================================== &&
......
......@@ -5,7 +5,7 @@ echo Welcome to MLSP 2019 Software Package! &&
echo ============================================================================================== &&
echo Lets start with Mask R-CNN! &&
cd mask_rcnn &&
#./run_maskrcnn.sh &&
./run_maskrcnn.sh &&
echo Successfully finished Mask R-CNN! &&
echo ============================================================================================== &&
cd ../sa_fcn &&
......@@ -28,6 +28,14 @@ echo ===========================================================================
echo Lets generate Figure 4! &&
python figure_4.py &&
echo Successfully finished generating Figure 4! &&
echo ==============================================================================================
echo Lets generate Figure 5! &&
python figure_5.py &&
echo Successfully finished generating Figure 5! &&
echo ==============================================================================================
echo Lets generate Figure 6! &&
python figure_6.py &&
echo Successfully finished generating Figure 6! &&
echo ============================================================================================== &&
echo We are done here! Thank you. &&
echo ==============================================================================================
......@@ -6,6 +6,19 @@ currentFolder = pwd;
idcs = strfind(currentFolder,'/');
baseDir = currentFolder(1:idcs(end)-1);
figure;
h = [];
h(1) = subplot(3,3,1);
h(2) = subplot(3,3,2);
h(3) = subplot(3,3,3);
h(4) = subplot(3,3,4);
h(5) = subplot(3,3,5);
h(6) = subplot(3,3,6);
h(7) = subplot(3,3,7);
h(8) = subplot(3,3,8);
h(9) = subplot(3,3,9);
for exp_number = 1:5 %experiment number
......@@ -121,11 +134,18 @@ for exp_number = 1:5 %experiment number
write_name_post = strcat('test', ds, '_', int2str(i), '_post.mat'); % generate file name for post processed prediction
write_name_gt = strcat('test', ds, '_', int2str(i), '_truth.mat'); % generate file name for ground truth
write_name_post_bmp = strcat('test', ds, '_', int2str(i), '_post.bmp'); % generate file name for post processed prediction
image(testI,'CDataMapping','scaled','Parent',h(1));
% save
save(strcat(write_dir_post, write_name_post), 'testI');
save(strcat(write_dir_gt, write_name_gt), 'gtI');
imwrite(testI, strcat(write_dir_post, write_name_post_bmp));
bigtestI=cat(2,bigtestI,testI); % Concatenate arrays along specified dimension, 2 means it gona be one next to another, 1 would mean it would be one on top of another
biggtI=cat(2,biggtI,gtI); % Instead of calculating each image seperately, they are creating one huge and calculate the metrices at once
......
......@@ -4,10 +4,10 @@
echo Welcome to SA-FCN! &&
echo ============================================================================================== &&
echo Lets start with some training! &&
for i in {1..5}
do
python3 -W ignore python/train.py Gland;
done || exit 1
#for i in {1..5}
#do
# python3 -W ignore python/train.py Gland;
#done || exit 1
echo Successfully finished training! &&
echo ============================================================================================== &&
......@@ -16,9 +16,19 @@ python3 -W ignore python/predict_x5.py &&
echo Successfully finished predicting! &&
echo ============================================================================================== &&
echo Lets do some post processing! &&
echo Lets do some our post processing! &&
/opt/apps/matlab/r2019a/bin/matlab -nodisplay -nosplash -nodesktop -r "run('post_processing/pp_our_automatic_x5.m');exit;" &&
echo Successfully finished post processing &&
echo Successfully finished our post processing &&
echo ============================================================================================== &&
echo Lets do some dcan post processing! &&
/opt/apps/matlab/r2019a/bin/matlab -nodisplay -nosplash -nodesktop -r "run('post_processing/pp_dcan_automatic_x5.m');exit;" &&
echo Successfully finished dcan post processing &&
echo ============================================================================================== &&
echo Lets do some original post processing! &&
/opt/apps/matlab/r2019a/bin/matlab -nodisplay -nosplash -nodesktop -r "run('post_processing/pp_original_automatic_x5.m');exit;" &&
echo Successfully finished original post processing &&
echo ============================================================================================== &&
echo Lets do some pdf! &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment