In [11]:
%matplotlib inline
%pylab inline


Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['exp', 'e']
`%matplotlib` prevents importing * from pylab and numpy

Load Results


In [12]:
from alabortcvpr2015.utils import pickle_load

path = '/data/'
exp = 'lfpw_fast_dsift'

legend_entries = ['Initial',
                  'AAM-PIC',
                  'AAM-AIC',
                  'CLM-RLMS',
                  'UNI-PIC-RLMS',
                  'UNI-AIC-RLMS']

aam_pic = pickle_load(path + 'PhD/Results/aam_pic_' + exp)
aam_aic = pickle_load(path + 'PhD/Results/aam_aic_' + exp)

clm_rlms = pickle_load(path + 'PhD/Results/clm_rlms_' + exp)

unified_pic_rlms = pickle_load(path + 'PhD/Results/unified_picrlms_' + exp)
unified_aic_rlms = pickle_load(path + 'PhD/Results/unified_aicrlms_' + exp)

results = [aam_pic, aam_aic, clm_rlms, unified_pic_rlms, unified_aic_rlms]

Explore Results

CEDs


In [13]:
initial_errors = [fr.initial_error() for fr in unified_aic_rlms]

final_errors = []
for fitter_results in results:
    final_errors.append([fr.final_error() for fr in fitter_results])
    
errors = [initial_errors] + final_errors

In [14]:
from menpofit.visualize import plot_ced

plot_ced(errors, legend_entries=legend_entries)


Statistics


In [9]:
from __future__ import division

print '\t\t', 'Mean \t', 'STD \t', 'Median \t', 'Convergence \t'

for err, method in zip(errors, legend_entries):
    print method, '\t', 
    print np.round(np.mean(err), decimals=4), '\t', 
    print np.round(np.std(err), decimals=4), '\t', 
    print np.round(np.median(err), decimals=4), '\t',
    
    c = 0
    for e, ini_e in zip(err, errors[0]):
        if e < ini_e:
            c+=1
        
    print np.round(c / len(err), decimals=4)


		Mean 	STD 	Median 	Convergence 	
Initial 	0.0914 	0.0382 	0.0854 	0.0
AAM-PIC 	0.0399 	0.0362 	0.028 	0.9509
AAM-AIC 	0.0248 	0.0145 	0.0216 	1.0
CLM-RLMS 	0.0304 	0.0168 	0.0261 	0.9955
UNI-PIC-RLMS 	0.0296 	0.0182 	0.0251 	0.9955
UNI-AIC-RLMS 	0.0242 	0.0136 	0.0212 	1.0

Experiment 1


In [10]:
it_errors = []

for fitter_results in results:
    all_errors = np.asarray([fr.errors() for fr in fitter_results])
    it_errors.append(np.mean(all_errors, axis=0))
    
it_errors = np.asarray(it_errors)

plot(xrange(it_errors.shape[1]), it_errors.T, linewidth=2)
legend(legend_entries[1:])
xlim((0, 20))
xlabel('Number of Iterations')
ylabel('Mean Normalized Point-to-Point Error')
plt.gcf().set_size_inches((7, 5))