⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 runkfda.m

📁 It is for Face Recognition
💻 M
📖 第 1 页 / 共 3 页
字号:

% test case 2.2: n=40, minLocalSampleRatio     = 0.25;
    0.9079    0.8903    0.5833    0.9145    0.8375    0.7813
    0.9558    0.9402    0.5763    0.9558    0.8917    0.8500
    0.9333    0.8667    0.5125    0.9333    0.7875    0.8250
    0.9873    0.9125    0.6410    0.9873    0.9125    0.8875
    0.9200    0.9091    0.5395    0.9200    0.8625    0.8625
    0.9324    0.8831    0.5897    0.9595    0.8000    0.8375

% test case 2.3: n=40, minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3
    0.9079    0.8625    0.5750    0.8688    0.8375    0.7813
    0.9558    0.9167    0.5667    0.9000    0.8917    0.8500
    0.9333    0.8125    0.5125    0.8750    0.7875    0.8250
    0.9873    0.9125    0.6250    0.9750    0.9125    0.8875
    0.9200    0.8750    0.5125    0.8625    0.8625    0.8625
    0.9324    0.8500    0.5750    0.8875    0.8000    0.8375
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% n=40;
wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
recRate=[]; ct=[];
ids=[1:40];

for t=1:6
  if t==1
    poses = [1 2 4 5 9 10]; xPoses = [3 6 7 8];
  elseif t==2
    poses = [1 3 5 6 7 8 10]; xPoses = [2 4 9];
  elseif t==3
    poses = [1 2 3 4 6 7 8 9]; xPoses = [5 10];
  elseif t==4
    poses = [2 3 4 5 6 7 9 10]; xPoses = [1 8];
  elseif t==5
    poses = [1 3 4 5 6 8 9 10]; xPoses = [2 7];
  else
    poses = [1 2 4 5 7 8 9 10]; xPoses = [3 6];
  end

  [recRate(t,:), ct(t)]=testMultiModelFaceRecognition(Fm1, Fm2, Fm3, wt1, wt2, wt3, R1, R2, R3, ids, poses, xPoses, 'n');
  %[recRate1, ct1]=testMultiModelFaceRecognition(Fm1, Fm2, Fm3, wt1, wt2, wt3, R1, R2, R3, ids, poses, xPoses, 'y');
end 

recRate


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test set (3)
% n=40, m=6 (known face per person)
% parameters:
% wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
% minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
% test case 2.3: n=40, minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3     time
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
recRate=[]; ct=[]; m=6;
for k=1:80
  x = randperm(10);
  x1 = sort(x(1:m));
  x2 = sort(x(m+1:10));
  p(k,1:10)=[x1, x2];
end
offs=randperm(80);
testPoses = p(offs(21:30), 1:10)

testPoses=[
     1     4     7     8     9    10     2     3     5     6
     1     2     4     8     9    10     3     5     6     7
     2     6     7     8     9    10     1     3     4     5
     1     2     5     7     9    10     3     4     6     8
     1     2     3     7     8    10     4     5     6     9
     1     2     4     5     8    10     3     6     7     9
     1     2     3     4     5     8     6     7     9    10
     1     2     3     7     8    10     4     5     6     9
     1     3     5     6     7    10     2     4     8     9
     1     5     6     7     9    10     2     3     4     8
];


ids=[1:40]; m=6;
for t=1:10
  poses = testPoses(t,1:m); xPoses=testPoses(t,m+1:10);  
  [recRate(t,:), ct(t)]=testMultiModelFaceRecognition(Fm1, Fm2, Fm3, wt1, wt2, wt3, R1, R2, R3, ids, poses, xPoses, 'n');
end 

result=[recRate, ct']

r=results;
fprintf('\n CombRate    R1          R2          R3          EigRate     RecTime(sec)');
r(11,:)=mean(r); N=40*4;
for k=1:11
   fprintf('\n %1.4f      %1.4f      %1.4f      %1.4f      %1.4f      %1.4f   ', r(k,1),r(k,2),r(k,3),r(k,4),r(k,6),r(k,7)/N);
end

% test case 2.3: n=40, minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3     time
results=[
    0.9456    0.8438    0.5250    0.8750    0.8125    0.8375   37.4060
    0.9392    0.8000    0.5250    0.8688    0.7750    0.8187   37.8130
    0.9007    0.8688    0.4750    0.8500    0.8063    0.7875   37.4720
    0.9145    0.8562    0.5313    0.8750    0.8375    0.8000   37.7070
    0.8919    0.8125    0.5188    0.8250    0.7562    0.7500   36.7990
    0.9067    0.8187    0.5313    0.8562    0.7562    0.8125   37.0970
    0.9139    0.7937    0.5000    0.8625    0.7500    0.7500   36.9410
    0.8919    0.8125    0.5188    0.8250    0.7562    0.7500   36.6440
    0.9608    0.9063    0.5500    0.9125    0.8500    0.8625   38.0190
    0.9346    0.9063    0.5500    0.8938    0.8250    0.8063   37.7850
];
===========================================================================
 CombRate    R1          R2          R3          EigRate     RecTime(sec)
===========================================================================
 0.9456      0.8438      0.5250      0.8750      0.8375      0.2338   
 0.9392      0.8000      0.5250      0.8688      0.8187      0.2363   
 0.9007      0.8688      0.4750      0.8500      0.7875      0.2342   
 0.9145      0.8562      0.5313      0.8750      0.8000      0.2357   
 0.8919      0.8125      0.5188      0.8250      0.7500      0.2300   
 0.9067      0.8187      0.5313      0.8562      0.8125      0.2319   
 0.9139      0.7937      0.5000      0.8625      0.7500      0.2309   
 0.8919      0.8125      0.5188      0.8250      0.7500      0.2290   
 0.9608      0.9063      0.5500      0.9125      0.8625      0.2376   
 0.9346      0.9063      0.5500      0.8938      0.8063      0.2362   
---------------------------------------------------------------------------
 0.9200      0.8419      0.5225      0.8644      0.7975      0.2336  (mean)
===========================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test set (4)
% n=30, m=6 (known face per person)
% parameters:
% wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wt1=ones(16);R1=420; wt2=ones(12);R2=400; wt3=ones(20);R3=860;
recRate=[]; ct=[]; 
n=30; m=8;
% gen ids
testIds=randperm(40);
ids=sort(testIds(1:n));
% gen poses
for k=1:80
  x = randperm(10);
  x1 = sort(x(1:m));
  x2 = sort(x(m+1:10));
  p(k,1:10)=[x1, x2];
end
offs=randperm(80);
testPoses = p(offs(21:30), 1:10)


% test data:
ids=[1     2     3     4     5     7     8     9    10    11    12    13    14    15    16    17    19    20    21    22    23    24    29    31    34    36    37    38    39    40 ];

ids=[11:40];
testPoses =[
     2     3     5     6     7     8     9    10     1     4
     1     3     4     5     7     8     9    10     2     6
     2     3     4     5     6     7     9    10     1     8
     1     2     4     5     6     7     8     9     3    10
     1     2     4     6     7     8     9    10     3     5
     1     2     3     6     7     8     9    10     4     5
     1     2     4     5     6     7     8     9     3    10
     1     2     5     6     7     8     9    10     3     4
     1     3     4     5     7     8     9    10     2     6
     1     2     3     5     6     8     9    10     4     7
];

recRate=[];ct=[];
for t=1:10
  poses = testPoses(t,1:m); xPoses=testPoses(t,m+1:10);  
  [recRate(t,:), ct(t)]=testMultiModelFaceRecognition(Fm1, Fm2, Fm3, wt1, wt2, wt3, R1, R2, R3, ids, poses, xPoses, 'n');
end 

result=[recRate, ct']
% minPoseCnt = 3;  minLocalSampleRatio = 0.30; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3     time
results=[
    0.9310    0.8167    0.6667    0.9333    0.8333    0.9333    7.9520
    0.9286    0.8500    0.7000    0.9000    0.8500    0.8500    7.8900
    0.9492    0.9000    0.6667    0.9500    0.9333    0.9167    7.0150
    0.9828    0.8833    0.5833    0.9500    0.8500    0.9333    7.5150
    0.9298    0.8500    0.5333    0.9000    0.8167    0.8833    7.6080
    0.8947    0.7833    0.5833    0.9000    0.7667    0.8333    7.1400
    0.9828    0.8833    0.5833    0.9500    0.8500    0.9333    7.3120
    0.8966    0.8167    0.5500    0.9000    0.8000    0.8667    7.3430
    0.9286    0.8500    0.7000    0.9000    0.8500    0.8500    7.3110
    0.9310    0.7833    0.6167    0.9333    0.7833    0.8333    7.4220
];
% minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3      time  
r=[  
    0.9310    0.8333    0.6833    0.9333    0.8333    0.9333    7.1250
    0.9643    0.8833    0.6833    0.9000    0.8500    0.8500    6.5770
    0.9661    0.8833    0.6667    0.9667    0.9333    0.9167    7.1870
    0.9828    0.8500    0.5833    0.9500    0.8500    0.9333    6.7490
    0.9298    0.8333    0.5167    0.9000    0.8167    0.8833    6.0770
    0.8772    0.7833    0.6000    0.9000    0.7667    0.8333    6.5150
    0.9828    0.8500    0.5833    0.9500    0.8500    0.9333    6.0780
    0.8966    0.8167    0.5500    0.9000    0.8000    0.8667    7.0300
    0.9643    0.8833    0.6833    0.9000    0.8500    0.8500    5.8750
    0.9310    0.8167    0.5833    0.9167    0.7833    0.8333    6.5770
];

===========================================================================
 CombRate    R1          R2          R3          EigRate     RecTime(sec)
===========================================================================
 0.9310      0.8333      0.6833      0.9333      0.9333      0.1187   
 0.9643      0.8833      0.6833      0.9000      0.8500      0.1096   
 0.9661      0.8833      0.6667      0.9667      0.9167      0.1198   
 0.9828      0.8500      0.5833      0.9500      0.9333      0.1125   
 0.9298      0.8333      0.5167      0.9000      0.8833      0.1013   
 0.8772      0.7833      0.6000      0.9000      0.8333      0.1086   
 0.9828      0.8500      0.5833      0.9500      0.9333      0.1013   
 0.8966      0.8167      0.5500      0.9000      0.8667      0.1172   
 0.9643      0.8833      0.6833      0.9000      0.8500      0.0979   
 0.9310      0.8167      0.5833      0.9167      0.8333      0.1096   
---------------------------------------------------------------------------
 0.9426      0.8433      0.6133      0.9217      0.8833      0.1097 (mean)  
===========================================================================
total rec attempt 600

fprintf('\n CombRate    R1          R2          R3          EigRate     RecTime(sec)');
r(11,:)=mean(r); N=30*2;
for k=1:11
   fprintf('\n %1.4f      %1.4f      %1.4f      %1.4f      %1.4f      %1.4f   ', r(k,1),r(k,2),r(k,3),r(k,4),r(k,6),r(k,7)/N);
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test set (5)
% n=40, m=8 (known face per person)
% parameters:
% wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
% minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
% test case 2.3: n=40, minPoseCnt = 3;  minLocalSampleRatio = 0.20; defaultNNErr = 0.005;
%   recRate   recRt1    recRt2    recRt3    eig1      eig3     time
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wt1=ones(16);R1=640; wt2=ones(12);R2=600; wt3=ones(20);R3=1000;
recRate=[]; ct=[]; m=8;
for k=1:80
  x = randperm(10);
  x1 = sort(x(1:m));
  x2 = sort(x(m+1:10));
  p(k,1:10)=[x1, x2];
end
offs=randperm(80);
testPoses = p(offs(21:30), 1:10)

testPoses=[
     2     3     4     5     7     8     9    10     1     6
     1     2     3     4     6     7     9    10     5     8
     1     2     3     5     6     7     8     9     4    10
     1     2     3     5     6     7     9    10     4     8
     1     2     3     4     5     7     8    10     6     9
     1     4     5     6     7     8     9    10     2     3
     1     2     3     4     5     6     9    10     7     8
     1     2     3     4     5     6     7     9     8    10
     1     2     4     5     6     7     8    10     3     9
     1     2     3     4     5     6     8     9     7    10
];


ids=[1:40]; m=8;
for t=1:10
  poses = testPoses(t,1:m); xPoses=testPoses(t,m+1:10);  
  [recRate(t,:), ct(t)]=testMultiModelFaceRecognition(Fm1, Fm2, Fm3, wt1, wt2, wt3, R1, R2, R3, ids, poses, xPoses, 'n');
end 

result=[recRate, ct']

result =[
    0.9333    0.8375    0.4875    0.8750    0.8125    0.8000    0.2544
    0.9605    0.8875    0.6250    0.9125    0.8750    0.8500    0.2597
    0.9221    0.8625    0.4875    0.8875    0.7875    0.7750    0.2628
    0.9744    0.9125    0.5625    0.9500    0.8875    0.8625    0.2310
    0.8919    0.8000    0.5125    0.8250    0.7875    0.8000    0.2327
    0.9733    0.9375    0.5500    0.9125    0.8625    0.8375    0.2195
    0.9615    0.8625    0.5125    0.9375    0.8625    0.8250    0.2351
    0.9620    0.8750    0.5750    0.9500    0.8500    0.8250    0.2293
    0.9342    0.8875    0.5500    0.8875    0.9000    0.8875    0.2697
    0.9221    0.8125    0.5125    0.8875    0.7875    0.8000    0.2484
];
r=result;
fprintf('\n CombRate    R1          R2          R3          EigRate     RecTime(sec)');
r(11,:)=mean(r); 
for k=1:11
   fprintf('\n %1.4f      %1.4f      %1.4f      %1.4f      %1.4f      %1.4f   ', r(k,1),r(k,2),r(k,3),r(k,4),r(k,6),r(k,7));
end
 CombRate    R1          R2          R3          EigRate     RecTime(sec)
 0.9333      0.8375      0.4875      0.8750      0.8000      0.2544   
 0.9605      0.8875      0.6250      0.9125      0.8500      0.2597   
 0.9221      0.8625      0.4875      0.8875      0.7750      0.2628   
 0.9744      0.9125      0.5625      0.9500      0.8625      0.2310   
 0.8919      0.8000      0.5125      0.8250      0.8000      0.2327   
 0.9733      0.9375      0.5500      0.9125      0.8375      0.2195   
 0.9615      0.8625      0.5125      0.9375      0.8250      0.2351   
 0.9620      0.8750      0.5750      0.9500      0.8250      0.2293   
 0.9342      0.8875      0.5500      0.8875      0.8875      0.2697   
 0.9221      0.8125      0.5125      0.8875      0.8000      0.2484   
 0.9435      0.8675      0.5375      0.9025      0.8263      0.2443   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -