InsightFace_TF icon indicating copy to clipboard operation
InsightFace_TF copied to clipboard

about distance calculation in verification.py script

Open tratotasia opened this issue 7 years ago • 1 comments

looking to line 50 and 51, the scripts diff = np.subtract(embeddings1, embeddings2) dist = np.sum(np.square(diff), 1) are use to calculate the distance between two embedding, but why not add an extra sqrt to the dist? like this. dist = np.sqrt(np.sum(np.square(diff), 1))

euclidean needs a extra sqrt operation, doesn't it?

tratotasia avatar Jul 31 '18 03:07 tratotasia

no, of course not. In fact, this dist represents cos distance. dist = 2 * ( 1 - cos ).

david-di avatar Aug 10 '18 06:08 david-di