openface/docs/demo-2-comparison.md

1.7 KiB

Demo 2: Comparing two images

The comparison demo outputs the predicted similarity score of two faces by computing the squared L2 distance between their representations. A lower score indicates two faces are more likely of the same person. Since the representations are on the unit hypersphere, the scores range from 0 (the same picture) to 4.0. The following distances between images of John Lennon and Eric Clapton were generated with ./demos/compare.py images/examples/{lennon*,clapton*}.

Lennon 1 Lennon 2 Clapton 1 Clapton 2

The following table shows that a distance threshold of 0.8 would distinguish these two people. In practice, further experimentation should be done on the distance threshold. On our LFW experiments, the mean threshold across multiple experiments is about 0.68, see accuracies.txt.

Image 1 Image 2 Distance
Lennon 1 Lennon 2 0.298
Lennon 1 Clapton 1 0.985
Lennon 1 Clapton 2 0.855
Lennon 2 Clapton 1 0.904
Lennon 2 Clapton 2 0.955
Clapton 1 Clapton 2 0.712