Skip to content

Instantly share code, notes, and snippets.

@avalchev94
Created May 25, 2021 11:59
Show Gist options
  • Save avalchev94/c132ca7b913d69a5b48626d2eb540c10 to your computer and use it in GitHub Desktop.
Save avalchev94/c132ca7b913d69a5b48626d2eb540c10 to your computer and use it in GitHub Desktop.
for face_idx, face in enumerate(profile.face_cluster.faces):
logger.debug(f'Looking at at face {face_idx} of profile {profile.id}')
centroid_distances = np.linalg.norm(centroids - np.array(face.embedding), axis=1)
logger.debug(f'Distances of profile {profile.id} to centroids: {centroid_distances}')
face_match = org_database.index[centroid_distances < self.threshold]
face_matches.update(face_match)
logger.debug(f'Face matches found: {face_match}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment