Add files via upload

main
pp00704831 3 years ago committed by GitHub
parent c76e6afef8
commit f8ac53b7a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,60 +1,60 @@
p = genpath('.\out\stripformer_10_patches');% GoPro Deblur Results p = genpath('.\out\Stripformer_GoPro_results');% GoPro Deblur Results
gt = genpath('.\datasets\GoPro\test\sharp');% GoPro GT Results gt = genpath('.\datasets\GoPro\test\sharp');% GoPro GT Results
length_p = size(p,2); length_p = size(p,2);
path = {}; path = {};
temp = []; temp = [];
for i = 1:length_p for i = 1:length_p
if p(i) ~= ';' if p(i) ~= ';'
temp = [temp p(i)]; temp = [temp p(i)];
else else
temp = [temp '\']; temp = [temp '\'];
path = [path ; temp]; path = [path ; temp];
temp = []; temp = [];
end end
end end
clear p length_p temp; clear p length_p temp;
length_gt = size(gt,2); length_gt = size(gt,2);
path_gt = {}; path_gt = {};
temp_gt = []; temp_gt = [];
for i = 1:length_gt for i = 1:length_gt
if gt(i) ~= ';' if gt(i) ~= ';'
temp_gt = [temp_gt gt(i)]; temp_gt = [temp_gt gt(i)];
else else
temp_gt = [temp_gt '\']; temp_gt = [temp_gt '\'];
path_gt = [path_gt ; temp_gt]; path_gt = [path_gt ; temp_gt];
temp_gt = []; temp_gt = [];
end end
end end
clear gt length_gt temp_gt; clear gt length_gt temp_gt;
file_num = size(path,1); file_num = size(path,1);
total_psnr = 0; total_psnr = 0;
n = 0; n = 0;
total_ssim = 0; total_ssim = 0;
for i = 1:file_num for i = 1:file_num
file_path = path{i}; file_path = path{i};
gt_file_path = path_gt{i}; gt_file_path = path_gt{i};
img_path_list = dir(strcat(file_path,'*.png')); img_path_list = dir(strcat(file_path,'*.png'));
gt_path_list = dir(strcat(gt_file_path,'*.png')); gt_path_list = dir(strcat(gt_file_path,'*.png'));
img_num = length(img_path_list); img_num = length(img_path_list);
if img_num > 0 if img_num > 0
for j = 1:img_num for j = 1:img_num
image_name = img_path_list(j).name; image_name = img_path_list(j).name;
gt_name = gt_path_list(j).name; gt_name = gt_path_list(j).name;
image = imread(strcat(file_path,image_name)); image = imread(strcat(file_path,image_name));
gt = imread(strcat(gt_file_path,gt_name)); gt = imread(strcat(gt_file_path,gt_name));
size(image); size(image);
size(gt); size(gt);
peaksnr = psnr(image,gt); peaksnr = psnr(image,gt);
ssimval = ssim(image,gt); ssimval = ssim(image,gt);
total_psnr = total_psnr + peaksnr; total_psnr = total_psnr + peaksnr;
total_ssim = total_ssim + ssimval; total_ssim = total_ssim + ssimval;
n = n + 1 n = n + 1
end end
end end
end end
psnr = total_psnr / n psnr = total_psnr / n
ssim = total_ssim / n ssim = total_ssim / n
close all;clear all; close all;clear all;

@ -1,60 +1,60 @@
p = genpath('.\out\Stripformer_HIDE_result');% HIDE Deblur Results p = genpath('.\out\Stripformer_HIDE_results');% HIDE Deblur Results
gt = genpath('.\datasets\HIDE\sharp');% HIDE GT Results gt = genpath('.\datasets\HIDE\sharp');% HIDE GT Results
length_p = size(p,2); length_p = size(p,2);
path = {}; path = {};
temp = []; temp = [];
for i = 1:length_p for i = 1:length_p
if p(i) ~= ';' if p(i) ~= ';'
temp = [temp p(i)]; temp = [temp p(i)];
else else
temp = [temp '\']; temp = [temp '\'];
path = [path ; temp]; path = [path ; temp];
temp = []; temp = [];
end end
end end
clear p length_p temp; clear p length_p temp;
length_gt = size(gt,2); length_gt = size(gt,2);
path_gt = {}; path_gt = {};
temp_gt = []; temp_gt = [];
for i = 1:length_gt for i = 1:length_gt
if gt(i) ~= ';' if gt(i) ~= ';'
temp_gt = [temp_gt gt(i)]; temp_gt = [temp_gt gt(i)];
else else
temp_gt = [temp_gt '\']; temp_gt = [temp_gt '\'];
path_gt = [path_gt ; temp_gt]; path_gt = [path_gt ; temp_gt];
temp_gt = []; temp_gt = [];
end end
end end
clear gt length_gt temp_gt; clear gt length_gt temp_gt;
file_num = size(path,1); file_num = size(path,1);
total_psnr = 0; total_psnr = 0;
n = 0; n = 0;
total_ssim = 0; total_ssim = 0;
for i = 1:file_num for i = 1:file_num
file_path = path{i}; file_path = path{i};
gt_file_path = path_gt{i}; gt_file_path = path_gt{i};
img_path_list = dir(strcat(file_path,'*.png')); img_path_list = dir(strcat(file_path,'*.png'));
gt_path_list = dir(strcat(gt_file_path,'*.png')); gt_path_list = dir(strcat(gt_file_path,'*.png'));
img_num = length(img_path_list); img_num = length(img_path_list);
if img_num > 0 if img_num > 0
for j = 1:img_num for j = 1:img_num
image_name = img_path_list(j).name; image_name = img_path_list(j).name;
gt_name = gt_path_list(j).name; gt_name = gt_path_list(j).name;
image = imread(strcat(file_path,image_name)); image = imread(strcat(file_path,image_name));
gt = imread(strcat(gt_file_path,gt_name)); gt = imread(strcat(gt_file_path,gt_name));
size(image); size(image);
size(gt); size(gt);
peaksnr = psnr(image,gt); peaksnr = psnr(image,gt);
ssimval = ssim(image,gt); ssimval = ssim(image,gt);
total_psnr = total_psnr + peaksnr; total_psnr = total_psnr + peaksnr;
total_ssim = total_ssim + ssimval; total_ssim = total_ssim + ssimval;
n = n + 1 n = n + 1
end end
end end
end end
psnr = total_psnr / n psnr = total_psnr / n
ssim = total_ssim / n ssim = total_ssim / n
close all;clear all; close all;clear all;

Loading…
Cancel
Save