forked from DeepMed-Lab/DeepRFT-AAAI2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
evaluate_GOPRO.m
34 lines (28 loc) · 1.04 KB
/
evaluate_GOPRO.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
close all;clear all;
datasets = {'GoPro'};
% datasets = {'GoPro', 'HIDE'};
num_set = length(datasets);
for idx_set = 1:num_set
file_path = strcat('./results/DeepRFT/GoPro/');
gt_path = strcat('./Datasets/GoPro/test/sharp/');
path_list = [dir(strcat(file_path,'*.jpg')); dir(strcat(file_path,'*.png'))];
gt_list = [dir(strcat(gt_path,'*.jpg')); dir(strcat(gt_path,'*.png'))];
img_num = length(path_list);
total_psnr = 0;
total_ssim = 0;
if img_num > 0
for j = 1:img_num
image_name = path_list(j).name;
gt_name = gt_list(j).name;
input = imread(strcat(file_path,image_name));
gt = imread(strcat(gt_path, gt_name));
ssim_val = ssim(input, gt);
psnr_val = psnr(input, gt);
total_ssim = total_ssim + ssim_val;
total_psnr = total_psnr + psnr_val;
end
end
qm_psnr = total_psnr / img_num;
qm_ssim = total_ssim / img_num;
fprintf('For %s dataset PSNR: %f SSIM: %f\n', datasets{idx_set}, qm_psnr, qm_ssim);
end