-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevaluate.m
48 lines (47 loc) · 1.08 KB
/
evaluate.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% sum = 0;
% str = ['head\','bust\','body\'];
% for sub = 0:2
% a1 = 'origin\';
% a1 = strcat(a1,str(sub*5+1:(sub+1)*5));
% a2 = 'result2\';
% a2 = strcat(a2,str(sub*5+1:(sub+1)*5));
% for mm =1:50
% b=".png";
% c=num2str(mm);
% name=strcat(a1,c,b);
% ori=dir(name);
% size1=ori.bytes/1024/1024;
% b=".png";
% c=num2str(mm);
% name=strcat(a2,c,b);
% res=dir(name);
% size2=res.bytes/1024/1024;
% x = size2/size1;
% sum = sum + x;
% end
% avg = sum/50
% sum = 0;
% end
%psnr
sum = 0;
str = ['head\','bust\','body\'];
for sub = 2:2
a1 = 'thumbnail\';
a1 = strcat(a1,str(sub*5+1:(sub+1)*5));
a2 = 'result2\';
a2 = strcat(a2,str(sub*5+1:(sub+1)*5));
for mm =1:60
b=".png";
c=num2str(mm);
name=strcat(a1,c,b);
ori=imread(name,"png");
b=".png";
c=num2str(mm);
name=strcat(a2,c,b);
res=imread(name,"png");
x = lpips(ori,res);
sum = sum + x;
end
avg = sum/60
sum = 0;
end