In [1]:
%pylab inline

import config
from itertools import imap
from stats import *
from datasets import lfw
from benchmarks import lfw as lfw_bench

sets_ground_truth = lfw.loadSetsGroundTruth()


Populating the interactive namespace from numpy and matplotlib

In [2]:
labels = ["LFW-a baseline results", "LFW 3D normalization"]
descs_files = ["ulbp_wpca_lfwa", "ulbp_wpca_lfw3d"]
scores = [lfw_bench.computeDistanceMatrix(descs, sets_ground_truth) for descs in imap(lfw_bench.loadDescriptors, descs_files)]
rocs = [lfw_bench.computeMeanROC(score) for score in scores]

In [5]:
plotROC(rocs, labels, title="")



In [6]:
for label, score in zip(labels, scores):
    mean, std = lfw_bench.computeMeanAccuracy(score)
    print "%s: %0.4f +/- %0.4f"%(label, mean, std)


LFW-a baseline results: 0.7805 +/- 0.0024
LFW 3D normalization: 0.8057 +/- 0.0051

In [8]:
labels = ["LFW-a baseline results", "LFW 3D normalization"]
descs_files = ["ulbp_pca_lda_lfwa", "ulbp_pca_lda_lfw3d"]
scores = [lfw_bench.computeDistanceMatrix(descs, sets_ground_truth) for descs in imap(lfw_bench.loadDescriptors, descs_files)]
rocs = [lfw_bench.computeMeanROC(score) for score in scores]

In [9]:
plotROC(rocs, labels, title="")



In [10]:
for label, score in zip(labels, scores):
    mean, std = lfw_bench.computeMeanAccuracy(score)
    print "%s: %0.4f +/- %0.4f"%(label, mean, std)


LFW-a baseline results: 0.8203 +/- 0.0072
LFW 3D normalization: 0.8275 +/- 0.0052

In [11]:
from learning.joint_bayesian import jointBayesianDistance

labels = ["LFW-a baseline results", "LFW 3D normalization"]
descs_files = ["ulbp_pca_jb_not_normalized_lfwa", "ulbp_pca_jb_not_normalized_lfw3d"]
scores = [lfw_bench.computeDistanceMatrix(descs, sets_ground_truth, jointBayesianDistance) for descs in imap(lfw_bench.loadDescriptors, descs_files)]
rocs = [lfw_bench.computeMeanROC(score) for score in scores]

In [12]:
plotROC(rocs, labels, title="")



In [13]:
for label, score in zip(labels, scores):
    mean, std = lfw_bench.computeMeanAccuracy(score)
    print "%s: %0.4f +/- %0.4f"%(label, mean, std)


LFW-a baseline results: 0.8265 +/- 0.0052
LFW 3D normalization: 0.8405 +/- 0.0052

In [14]:
print len(scores[0][0][0])


300

In [15]:
_ = hist(scores[1][0][0], bins=80, histtype="step", color="g")
_ = hist(scores[1][1][0], bins=80, histtype="step", color="r")



In [ ]: