Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created July 19, 2019 11:49
Show Gist options
  • Save mdfarragher/0bc9a086029d822186ccb73fb0f0dfda to your computer and use it in GitHub Desktop.
Save mdfarragher/0bc9a086029d822186ccb73fb0f0dfda to your computer and use it in GitHub Desktop.
// compare each face with all other faces
var edges = new List<SamplePair>();
for (uint i = 0; i < descriptors.Count; ++i)
for (var j = i; j < descriptors.Count; ++j)
// record every pair of two similar faces
// faces are similar if they are less than 0.6 apart in the 128D embedding space
if (Dlib.Length(descriptors[i] - descriptors[j]) < 0.6)
edges.Add(new SamplePair(i, j));
// the rest of the code goes here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment